I am trying to create a workflow that will insert the data from each repeated section in a form into a SQL table. This works fine if there is only one instance of the section used. However, if the user clicks "add" to repeat the section and enters data into multiple sections, only the first section is entered into the SQL table.
Question
Question
Insert multiple Forms sections into SQL table using Workflow
Answer
Yes, it will work the same. For the top fields, the token will stay the same, for the fields in the collection, you'd use the token from the For Each Row iteration.
Replies
Right, that's what i thought. It's not that simple. The tokens generated by Retrieve Form Content for tables are multi-value tokens. The Insert Data activity uses single values since it only inserts one row. So it takes the first value from your token only. In order to go through all the table rows, you need a For Each Row activity. Inside it, you can insert the current values into the table.
Can you post a screenshot of your workflow?
Hello Miruna, Thank you for your quick response. The workflow that I have is very simple. It is started after an approval is given in Forms and simply retrieves the content from the form and inserts to the db.
Will this apply to collection the same as it would a table? The top section of the form stays constant as it needs to be entered into the table but there can be multiple entries of sections if the user wishes.
Thanks,
Glenn
I should add that after adding the "after each row", I submitted a test form with 2 sections filled out there were 2 rows of data entered to the db rather than just one, but it duplicated the first section rather than moving on to the second section.
I didn't see the addition of the token from the Row Iteration, that resolved the problem. Thank you for your help Miruna.