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

Question

Question

Workflow to create folders from Query is duplicating existing folders in Laserfiche

asked on July 16, 2015 Show version history

I have a workflow that does a query to a SQL database and then copies a base folder with subfolders to build folders in Laserfiche for each row of data (<LastName>, <FirstName> <MI>), and then assigns a "Client ID" field value. 

This works, as long as no folders are pre-existing. Here is what it looks like after the first run with one folder (I deleted the others that were created to keep it simple.) The "000 AAA Base..." folder with its subfolders is the one that gets copied and renamed with each row in the query. "XXXXXabo, Cynthia K" is a result of this workflow running once. Her folder has all the subfolders as well. So far so good.

Now the issue: When I run the workflow again, Cynthia's folder gets duplicated and a "(2)" is attached. All the new folders come in just fine. But we want to make this workflow durable, so it can run every day, or multiple times a day, to bring in new clients and create folders for them (but not if they already exist!)

I would like some help with knowing how to have my workflow check for the existing folder name, and then not re-create the folder if it already exists.

 

Please advise. Thanks!

0 0

Replies

replied on July 16, 2015

You can use the "Conditional Sequence" activity inside your For Each Row loop to check if a folder already exists. Outside of the sequence, create a token using the same Last Name, First Name, Middle Init structure. Then in the conditional only run the moving activities inside if "Folder  : Contents ( [Parent Folder] ) contains an entry with 'Name equals %(Token Constructed Name)" . 

If you're not grabbing the Parent Folder at any point, you can use another Find Entry for that. 

 

Also if you're always copying the same base folder, you can move the Find Entry which gets its ID outside of the loop.

 

Hope that helps!

Sample WF.png
Sample WF.png (10.38 KB)
1 0
replied on July 17, 2015

Your Find Entry 2 needs either a path or an ID to that \CLIENTS folder where you would put the new folder (Right now you're only using a name not the path). The destination that you're using for the Move Entry activity should be the same (if it's the same folder each time Find Entry 2 can also be outside the For Each Row). In that case you'd use the Folder Contents: condition. 

Alternatively, if the Base folder which you're copying is in that folder, then you can continue using the Parent Contents condition, and wouldn't even need the Find Entry 2 and could use the same Entry from Find Entry (1). 

The conditional sequence is currently failing because no Entry is being passed to it. 

The workflow documentation will also be a good place to learn more about what the activities require. https://www.laserfiche.com/support/webhelp/workflow/9.2/en-us/LFWorkflow.htm#cshid=Resources/Activities/Find%20Entry.htm

1 0
replied on July 16, 2015

Thanks I will take a look at this tomorrow!

0 0
replied on July 17, 2015

Having trouble with configuring the steps. Need help with the secondary Find Entry and with the Conditional Sequence. 

 

This doesn't work:

 

What do I need to change?

0 0
replied on July 21, 2015

Got it. This works. I might try the 2nd configuration just because it looks simpler, but moving the Find Entry 2 outside of the For Each Row, and changing the Condition to an Entry and adding "Does not contain" seems to allow the folder building workflow to go ahead without duplicates.

Thanks so much

John Kimball

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

Sign in to reply to this post.