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

Question

Question

Workflow to delete shortcut if in same folder as the document it's pointing to

asked on August 29, 2016

I would like to occasionally run a workflow at night that would look at the documents in target folders, and delete any shortcuts that are in the same folder as the documents they are pointing to.  Not all the shortcuts would have the same name as the documents they reference.

Case scenario:  I have a workflow that will put a shortcut in a Roll #'d folder any time someone saves a Roll # in the Roll # field.  Most cases that's all I need.  In some cases, the document itself needs to be in the Roll # folder.  Result is, I have an original and a shortcut in that folder.  To make things worse, sometimes people will add the template and field data first, then Save, then Rename!  Then I've got the original, plus two shortcuts in one folder!

Trying to get WF to clean these up but can't figure out how to get WF to see the originating document ID and know which shortcuts are to that document.  It seems WF can only do this if the names are the same. 

0 0

Replies

replied on August 29, 2016

Why not modify the workflow that makes the shortcuts to check if the path for the shortcut is the same as the entry path before it makes the shortcut?

1 0
replied on August 29, 2016

The shortcut usually gets made first (from another WF) before the document gets moved to the folder.  This is what the users do:

  • they scan in doc (into Incoming Scans; usually arrives as Doc1, Doc2, or some other weird set of numbers)
  • they add template and field data (document saves; 1st WF1 activates if there is a number in the Roll # field)
  • then, if they haven't already, they name the document (if they name it after templating... WF1 activates again, sees another new document, checks for numbers in the Roll # field, finds them and creates shortcuts)
  • then they move the folder to wherever it needs to go; if they decide it should go in the Roll # folder, they drop it into the auto-filing folder and WF2 activates, moving the doc to the right folder.

 

The only way I could get around this is if I could delay the first WF from actually doing the work until, lets say, the next day.  Then, if the document did end up in the folder, it could check for that first and then not create the shortcut.  That also doesn't help if the WF is just looking for a matching name and the names don't match.

Is there no way for WF to match up by checking the original document ID instead of just comparing names?

0 0
replied on August 29, 2016

Or, can I add something to the WF that moves the original document into the Roll # folder?  Something that would tell it:  "Check for any shortcuts in this target folder and delete any you find."  This WF gets activated after the user names and templates a document, then drops it into an "auto-filing" folder that takes it to the right Roll # folder based on the Roll # in the template field.  (In most cases, the documents are being saved in the topic folders, not the Roll # folders; but, in these cases, one WF will have already created a shortcut to this document when the Roll # was added into the template and saved; then this WF moves the actual document into the Roll # folder).

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

Sign in to reply to this post.