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

Question

Question

Workflow: How to format data retrieved from business process variables for upload to SQL table?

asked on July 31, 2023 Show version history

I have a forms process that collects expense report data in a table and then triggers a workflow to upload the expenses to a SQL table.  The problem I'm having is that workflow sees the table data in separate variables for each column/field in the table.  The goal is to get the values formatted correctly so I can upload them to a SQL table.

Here's what I see in Workflow:

I tried doing a For Each Value of the RetrieveBusinessProcessVariables, but the results were not what I was looking for as I only got one record instead of two.
 

 

 

0 0

Answer

SELECTED ANSWER
replied on July 31, 2023 Show version history

If you are trying to append each row to the multi-value token, then you need to create the token prior to the "For Each..." activity, and within the "For Each..." activity, you would modify the token to append the new values to that multi-value token.

You should probably use the "For Each Row" activity instead of the "For Each Value", which will iterate through the rows of the table from the form.

Additionally, the tokens you are pushing into the token when appending to it, should be the tokens from the "For Each Value" activity, not from the original retrieved tokens.

It should look something like this:

     

 

Note - you should probably edit your post and change it to a question instead of a discussion, so that when you have a satisfactory response, you can mark it as the answer.

1 0
replied on July 31, 2023

Hey Matt,

I'm having a problem with the For Each Row activity; it doesn't allow me to select from Retrieve Business Process Variables:

 

0 0
replied on July 31, 2023

@████████ Make sure you have the table/collection selected in Retrieve Business Process Variables and not just the column variables.

The type should be Table or Collection with an asterisk. Any variable with a "\" means that is retrieving the column not the table/collection.

2 0
replied on August 1, 2023

Got it...now it works.  Thanks!

0 0
replied on August 1, 2023

Great!  Glad you've got everything working now.

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.