How to move multiple documents at once ?

Hello, everyone,

Quite new with Appian i' m struggling to move multiple documents at once.

I have a form where users can enter some details and update various documents. (first step of a longer process)

On submission of the form I have to :

  • Create one directory (which depends of the information entered in the form).
  • Upload all the documents in this particular directory.

I was thinking tu use smartservice on form submission but I can only use one in the saveinto.

I guess that I could use MNI or process looping in order to solve the issue but is there any better way to do this ?

Thanks for your help,

Nicolas

  Discussion posts and replies are publicly visible

  • Hi Nicolas - 

    To be honest, I'm not aware of the rationale for how the move document smart service was designed.  However, I believe it's good practice to move 1 doc at a time.  This is because in the event of unexpected behavior, it should be perfectly clear which documents were moved (and which were not).  If the smart service could handle 1-n documents, and there was an error, it would likely be an unpleasant exercise to determine precisely which documents were moved successfully.

    Often times (not always) designs include DB writes associated with document moves. Again, by moving docs 1-at-a-time, you have very precise control over those writes, always keeping them in sync with the documents being moved. 
    Tying this point into the point made above, think about this scenario:
    You had to move 10 documents, and each doc requires a related db entry. 
    The document move is initiated and breaks for reasonX after n documents were moved. 
    The process never flowed into the write to data store task.  Some documents got moved, but none have their related db updates....

    Flipping this the other way, if you mni through a sub-process that flows through the move followed by the write, you'll get your db entries for all the successful moves...

  • Hi,

    Thanks for your answer. I do agree with your point even if we can imagine a function that return a list of sucessfully / or not moved documents in order to deal with further steps.

    For now I have implemented a process looping to handle my moving, so I will just consider that this one correct way of doing this.

    But well maybe my design was broken from the beginning. The fact is that on the interface I upload documents through upload field, and so I have to enter a folder target. But at this point I do not know in wich folder the document will be set. I will know this only on submission of the interface.

    So for now my steps are :

    Upload documents (interface) => doc goes to appian temp folder, target is set to a temp custom folder as definitive one is not known

    Submit interface => documents are moved in the target folder, I create definitive destination folder through smart service.

    Process looping => I gather the list of documents, and move them from temp custom folder to definitive one.

    Is there a way to directly move the documents to the definitive folder ? (= changing the target folder set initially in the upload file field before the move from tmp appian folder to target destination folder happen.)

    Thanks, for your help,

    Nicolas

  • Hi,

    Can you please explain how to move multiple docs to a folder?

  • 0
    Certified Lead Developer
    in reply to kunals5028

    Do you mind sharing a few details?

    In general, the "Move Document" smart service only takes a single document and you need to create a loop in a process to move a list of docs.

  • There is folder in which all the excels from the email will be dropped using RPA after that we need to move all the documents from the folder to the archive folder, I just want to know how to loop the Move Document smart service

  • 0
    Certified Lead Developer
    in reply to kunals5028

    I suggest to use a subprocess you develop yourself that accepts a target folder and a list of documents, which can then loop and/or call the move document smart service via MNI, and protect against an empty initial list.  That way you can easily test your "utility" subprocess against various use cases, and simply plug it into a parent process when needed.

    Note: for either MNI or looping, if the list could ever exceed 1000 items, you will need to do something special to handle it.  This is rare though so it's usually not worth the extra effort unless you know in advance that it'll be possible.

  • in my site i have send e-mail button in front of each row which when clicked should send all the data in that particular row. i want to know how to fetch data of record type in that row to my E-mail content 

  • 0
    Certified Senior Developer
    in reply to kunals5028

    I think , Sending Email Means you are triggering a PM , pass fv!row to a process variable and you can reference that in Email body

  • Yes, while using PM, i used a custom HTML template and i set it up with substitution keys for replacement.
    So, when i click "send email" the PM should pick the values of that particular row only and replace it in the email with ###variable### type keys.