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

Question

Question

Workflow Custom Query - how to access the result data?

asked on April 29, 2020

I have a SQL table that contains a list of people and their birth dates people with the same FamilyFileNumber are members of the same family. 

Based on a unique identifier (Family File Number) found on the starting entries template field, I have written a SQL query that will find the youngest person in the family.  I need to capture that person's birth date and using the date token calculator in workflow add 28 years to it.  

 

The query does find 1 result but I don't see anywhere that I can access the date that was found.  If I track tokens on the custom query my only options are "results found" and "results count".

And in the date calculator there aren't any tokens.

Any help would be greatly appreciated!

Sandy

 

2 0

Answer

SELECTED ANSWER
replied on April 29, 2020

If you go back to your Custom Query and click on the 'Test' link under the query parameters then the tokens become available inside the For Each Row activity.  (They don't become available until after you 'test' the query at least once).

6 0

Replies

replied on April 29, 2020 Show version history

Sandy,

You would access the results of your Custom Query using a For Each Row activity.  In the For Each Row activity set the 'Get Rows From' property to the Results of the Custom Query.  The tokenized fields  returned by your query will then be available inside the For Each Row activity for you to use.

1 0
replied on April 29, 2020

Hi Cliff,

I took a look with Sandy and we set up a test with a simpler select statement, and a for each row activity, and still cannot access the results of the query:

 

0 0
SELECTED ANSWER
replied on April 29, 2020

If you go back to your Custom Query and click on the 'Test' link under the query parameters then the tokens become available inside the For Each Row activity.  (They don't become available until after you 'test' the query at least once).

6 0
replied on April 29, 2020

Just tested it and it worked for me. Thanks Cliff!

0 0
replied on April 29, 2020

You are welcome!  After you use the data activities for a while it becomes second nature to test the query before proceeding so the tokens become available later on in the workflow...

0 0
replied on April 29, 2020

That's excellent - it worked!!  Thanks so much Cliff - wish I'd asked earlier :-)

0 0
replied on May 1, 2020

I was able to reference the token in Workflow but the token isn't populating with the result.

This is the custom query in Workflow

When I run the Query in SQL it works

But when I run the workflow the results indicate the the custom query found something but it isn't display the data.

What am I missing?

Thanks

Sandy

0 0
replied on May 1, 2020 Show version history

Add a Track Tokens activity in the For Each Record loop to see what value is actually being returned from the Custom Query.  You might also try having the SQL SELECT statement return some of the other fields in the table to make sure you are getting a good record returned. (Again, you can use the Track Tokens activity to see what values are being returned)

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

Sign in to reply to this post.