You are viewing limited content. For full access, please sign in.

Question

Question

Workflow to move a file into a folder based on the folder ID and not the folder path

asked on October 4, 2021 Show version history

I would need a way to move a document into a folder based on the folder's entry ID instead of the folder's path but I don't know how to do it, if that is even possible...

My workflow:

  • I have multiple Form processes used by students to submit documents, they can submit multiple documents at the same time
  • Each document triggers a workflow that tries to move the document into the correct Student folder, based on the Student ID that we got from each document.
  • The workflow searches in the repository for the Student folder, if it exists it moves the document into the Student folder (the location of this folder does not matter in this case), if not it creates the student folder into a central location in the repository (Repository\Student Management\FileRoom)
  • Depending on the type of document, this Student folder can be automatically moved into a different location for review (Repository\Student Management\FileRoom\Review)

 

Now the issue:

  • When my first document is received, my workflow searched for the Student folder, found it in Repository\Student Management\FileRoom and moved the document into this Student folder based on the location of my folder. Then, because of the document type, my Student folder has been moved into Repository\Student Management\FileRoom\Review.
  • Almost at the same time, another document for the same student is submitted, my workflow searched for the Student folder, found it in Repository\Student Management\FileRoom. But by the time it really moved the document into the Student folder, my Student folder has been moved into Repository\Student Management\FileRoom\Review because of the previous document.
  • Because the workflow for this second document expects a Student folder in Repository\Student Management\FileRoom but it is no longer there, it creates a new Student folder in Repository\Student Management\FileRoom and now I have 2 Student folders for the same student, in 2 different locations.

 

The "logical" thing that comes to my mind would be to get the entry ID of my Student folder and then move the document based onto this entry ID. This way, no matter where the Student folder moves, I could still move the document into the correct Student folder, because its entry ID will remain the same.

But I can't find a way to make that happens. The "Move" task can only define the location based on a path and not an entry ID, and I was not able to find another solution. I am open to any suggestion.

Meanwhile I set a "Delay" task in my workflow before I move the Student folder, so it gives more time to move all the incoming documents into the Student folder before the workflow moves it into the Review folder. It works but it is definitely not ideal...

0 0

Replies

replied on October 5, 2021

When you perform your first search and find a result, if you then perform a Find Entry for that result, you now have 2 output Tokens, one for the Entry ID of the found document, and the other for the parent Folder (ID or Path). Knowing this ID, you could then perform a Find Entry for the Parent ID before your move and then pick the Path for that Parent Folder at that time. 

I have not seen in Workflow (Self Hosted) where you can Move or Route to an Folder ID, but have to use a UNC Path

 

0 0
replied on October 5, 2021

Thank you for the answer.

I already have the Parent Folder ID and Parent Folder path, I am looking for a way to route my document using the ParentFolder ID and not the path (or any other solution to make it work every time). Because sometimes between the moment I get the Parent Folder path and the moment I move my document, the parent folder has moved.

I will try to add a new Find Entry based on the parent folder ID I already have, right before moving my document, this should at least reduce the time between when I find my (updated?) Parent Folder path and the moment I move my document.

0 0
replied on October 5, 2021

Hi Pierre, this is one of the reasons I've move most of my workflows to Forms Based processes, instead of moving files or folders around between folders.

0 0
replied on October 6, 2021

Moving entries is done by path, there is no way to specify the ID.

0 0
replied on October 21, 2021

How about not creating the folder when the document is saved, instead put the move document inside of a try-catch activity inside of a repeat loop until success?  If the move fails delay 1 minute, find the entry and then try again.  Limit the tries to 5 times and then terminate the workflow on success = false.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.