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

Question

Question

LF Cloud - Multi Value output parameters from forms?

asked on July 6, 2021

Hey Answers,

I'm developing a solution for a customer wherein we would like to pass all values of all rows of a table to workflow, however, when I select these fields in the output parameters dialog I see no option to set them as multi valued. The resultant parameter sent to workflow is simply the first row of the table with none of the other values from the subsequent rows. Is there something I'm missing or am I going to have to push all the values into a multi line field with javascript, hide it, and then parse it out on the workflow side?

Thanks in advance!

-Hunter

4 0

Replies

replied on November 15, 2021

This is a simple way that I've done it

Create Input Paramater's (Multi-Token) in Workflow to match the Table fields of the Forms Table.

Assign the Table fields to the Input Parameters in Forms (Workflow Output)

Create a For Each Value Loop using one of the Input Multi-Token fields that always contains a value (ie: I choose the Name field)

In your Run Rule, In the Parameters, assign the Value to the input field using the Input Parameter field and using the token editor, set Apply Index with the loop iteration.

The iteration will pick the value from the Multi-Value token on each loop

(ie: Index 1 is field value 1, etc). 

Do this for each value being written to. 

 

2 0
replied on September 27, 2022

THIS!

 

I finally got something to work in cloud!

In On-Prem solutions passing Forms table data to Workflow and then into DBs is childsplay and until I found this thread I thought it was simply beyond Cloud.

Setting an iteration on the multivalue tokens did it as long as you've got one thing you know will be in the table so you can update the right row.

Thanks for the trailblazing!

0 0
replied on July 6, 2021

Hi Hunter,

I believe you would first need to select the Input Parameter to be multivalued in your Workflow, then you would be able to iterate through the values.

1 0
replied on July 6, 2021

It is! Well, they are.
The input parameters are behaving exactly right and I'm able to push multiple values as rows to the table, it's getting the multiple values back (in case a user makes a change to the table) is where I'm stuck.  

1 0
replied on July 7, 2021

So the way I solved this problem was by creating corresponding string fields in a hidden section and used a simple formula (=Table.column) to get all the values separated by commas. This is an okay workaround, but was just wondering if this was something that I'll need to be ready to implement on each output parameter that has multiple values.

Also created some javascript but ran into some issues using the "on submit" event listener. 

0 0
replied on July 18 Show version history

I'm not sure if this was resolved some other way in the meantime, but encountered the same issue and the solution above didn't resolve all the problems. I could get more than row of a table to pass through to the workflow using the For Each Value iteration approach, which is progress. But, I wasn't reliably able to get the data across. For some reason, it wouldn't reliably identify the values and run the correct number of times.

I had a form in a business process with a table that users could enter information into, and I needed that user-provided data to be transferred to the workflow via input parameters. I could see from the token tracker that all the rows were being delivered to the workflow.

The next step in the workflow was a Run Rule to take that data and insert it into a Lookup Table. But, the For Each Value activity seemed to insert a random number of rows, with repeats of some rows or skipping others entirely.

I was able to resolve this by eliminating the For Each Value activity. First, I created a hidden text box in the form that contained a formula to fill with the data from the column (=Table.YourColumnName).

 

I replaced the input parameters for the workflow with the data from that text box (now comma delimited) and redesigned it with a Repeat activity. The condition for the Repeat activity was set to an Assign Token Value that (the token is called "Row Count" in my example), using functions for splitting by commas and the Value Count function, outputted the number of rows from one of the input parameter columns. 

The "Start the Iteration token at" needed to be set to "1" because this is being used as the row number, and there is no "0" row.

The inputs into the Run Rule needed to be (1) split using the function and (2) Indexed to the Repeat - Iteration so the data from each column would be placed in the correct row.

This successfully inserted the correct number of rows and indexed correctly. The order of the rows gets mixed up and appears to be random, but that might be something to do with the repeat generating several Run Rule activity invocations and the server loads having capacity for them at different times? Perhaps a delay activity would assist with the order issue, but it isn't a problem for our purposes if the rows aren't in the same submission order.

This seems way too complicated - For Each Value should be able to handle multivalue tokens delivered from input parameters out of the box.

 

EDIT: I was able to solve the row order issue by adding a column with the submitter's name and the repeat iteration number into the Lookup Table. When pulling the data, I had the rule sort by that column, restoring the submitter's original table order.

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

Sign in to reply to this post.