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

Question

Question

Workflow Query Data - For Each Row to Create a doc creates duplicate docs based on first row of query

asked on September 22, 2021 Show version history

I have a sql db that contains a table with 25 business license entries.  I want to use Workflow to automatically create a document for each row - business license certificates for each specific business called out in the table.  The Workflow runs, but creates 25 duplicate entries - all based on the first row in my table.

I have been through any posts I can find, related to what I am doing, and can't seem to make it work.  I only get 25 copies of the same document.

I know I am doing something wrong.  Any help would be appreciated.

Thanks,

Christine

0 0

Answer

SELECTED ANSWER
replied on September 22, 2021 Show version history

Most likely you are using the incorrect token. In the token selector, are you using the tokens that look like %(Retrieve2021LicenseInfo..._License_Number) or the ones that look like %(ForEachRow_License_Number)?

 

Using the token from the original query will always use the first row, which results in the behavior you are seeing.

 

Using the token from the 'For Each' activity will use the current iteration of the row.

2 0
replied on September 22, 2021 Show version history

Thanks so much Brett!!!!

You have no idea how long I have been struggling with this!

The screenshots below show where I found the "for each row" token (all new to me) that you recommended in your post.  Showing it here in case someone needed clarification on how to get there (it took me a few to find it, but your screenshots were excellent!).

I appreciate you sharing your knowledge!  I wish you the best day today!!!  You have made mine much better!

Christine

Be sure to update the document name - so it uses "For Each Row" values as well.

Example of our naming convention using for each row tokens:

Business - 2022 - Lic # %(ForEachRow_Account_Number) - %(ForEachRow_Bus_Name) - %(ForEachRow_Manager_Last_Name), %(ForEachRow_Manager_First_Name) - %(ForEachRow_Issue_Date) - Certificate Add 6 Mo

 

0 0
replied on September 22, 2021

No problem. It is definitely a common mistake that I would bet most people have made before.

0 0

Replies

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

Sign in to reply to this post.