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 :
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,
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...
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,
© 2021 Appian. All rights reserved.