I'm attempting to query multiple rows on a database which will bring back data for each row. For each row I'd like to assign that value an individual token so I can populate specific Fields in a Form using Invoke Business Process. I've been attempting to use For Each Row to Assign a Multi-Value Token, then a For Each Value to modify the Token... but I'm not success and I'm thinking I may be on the wrong track. Any suggestions?
Question
Question
Mulit-Value Token to Populate Individual Fields in Forms via Invoke Work Process
Answer
When you created the token, you left it blank, right? You didn't set it to something like the query token.
Replies
Why not modify the token as you collect the values in For Each Row?
Are you trying to start one forms process per value or one with all the values? What exactly doesn't work for you?
I'm attempting to use one form process with all the values (each becoming their own variable on the form). I have added a token modification for each row, but I believe I'm not doing the correct type of modification because the token value I retrieve from this step still only brings back the first row data. I think I'm struggling with the action I need to take on the token to make it individually identifiable so I can use it to populate the form.
When you use a multi-value token in a single value situation (like for setting a Forms single-value field), Workflow doesn't know which value you want, so it always uses the first one. You can use token indexing to specify which value you want. Once you set the token, right-click on it and choose Token Editor from the context menu. You'll see this dialog:
But that would require you to know exactly how many values you have, so I think I'm still missing something in your scenario. Maybe you can add a screenshot of the form fields?
The good news is that I do know exactly how many values I will have (10).
I've assigned the first three tokens with Indexing, but you are correct I'm still missing something. I still am populating the same value in all three fields. I've attached screen shots of my Process Variables in Forms and the process for far on WorkFlow.
Under For Each Row, you want to use the current value token, not the one from the query.
I updated the for each row to use the correct value and I know we are getting close, but now the Form's variables show the 3rd number on the data table in all three positions (rather than the first, which is what was happening previously.
Results:
Previous Results:
Data Table:
Oops, missed that in your original screenshots. You want to create the token as a multi-value token before you go into the For Each loop. Then just append to it inside the loop. Otherwise, you're recreating it every time, so it ends up with just the last value.
Sooooo close... What is happening now is that it's duplicating the first row for both BagNo1 and BagNo2, which is pushing the other two rows down.
When you created the token, you left it blank, right? You didn't set it to something like the query token.
That's exactly what I had done! It's working now! Thank you for all your assistance in getting this working!