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

Question

Question

Workflow custom query multiple rows - to one token ?

asked on April 4, 2017

Hi,

Is it possible to dump all the rows returned from a custom sql query to a single token which could be used to later populate say a field on a pdf or a word file ?

Struggling to capture all the rows into one comment.

Thanks

0 0

Replies

replied on April 4, 2017

After your SQL query, use a For Each Row activity to append to a multi-value token.

1 0
replied on April 4, 2017

I have tried that, created blank token prior to the for each row activity, used append and right after the for each i guess the token gets overwritten by the last or the first row of the query. I have not tried filling out pdf inside the for each row activity. In the Email you see I only see one row data in the token.

foreachrow.PNG
append_values.PNG
0 0
replied on April 4, 2017

The 3 tokens you create need to be multi-value tokens. It looks like you didn't check that box when you created them. Then you want to set your action inside the For Each Row loop to append.

0 0
replied on April 4, 2017

Done all that, here are the screenshots i appreciate what i might be missing here ? The email i receive after the loop has only one row of the value, although query returns 4 rows.

Workflow_test.PNG
create_token_multiple_val.PNG
append_values_multitoken.PNG
email_editor_tokens.PNG
0 0
replied on April 4, 2017 Show version history

Your tokens aren't formatted to return multiple values (in the email).  Check "Apply Index," "All Values Separated By."

1 0
replied on April 5, 2017

Thanks, now will have to figure out how to make sure how to map each of the three different tokens to each other. Example if 3 results from sql with 3 column values need to be arranged so row 1 of the token corresponds to the first row of sql query with each column listed under each other.

 

Example if i am getting this results from custom query (3 rows and 3 column values):

Row 1: A1, A2, A3

Row 2: B1, B2, B3

Row 3 : C1, C2, C3

 

Trying to get one single token or formatting at end of it all such that  it looks like:

A1

A2

A3

B1

B2

B3

C1

C2

C3

0 0
replied on April 5, 2017

Oh nvm figured it out to get it to that format, instead of three tokens i ended up using one token only in the foreach row activity :).

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

Sign in to reply to this post.