- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2023 12:29 PM
I'm using flow designer to trigger after my catalog item is submitted, my first action is getting the catalog variables from the form which is a MRVS set so it's an array of objects. Then I'm using the For Each flow logic so I can access the data pills in each object and calling custom actions that will do specific things to the variables. Lastly I created a REST step using IntegrationHub that will send a POST request with the request body containing the output data pills from the last action in the for each loop. The problem is that I need the REST action to be after the loop but I can't access the data pills from the last action because they are in the for each branch. If I put the REST action in the loop, I can access the data pills but it's just gonna send a post request for each row in the form. I've tried using flow variables after the actions in the loop and then using the flow variables in the REST step but I only get the data from the last row.
Any help is much appreciated!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2023 06:31 AM
Thank you for your responses Michael, I ended up figuring it out. I scripted my own loop instead of using the For Each flow logic and that worked since now there's just one main branch.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2023 01:09 PM
I'm a little confused. If you are setting a flow variable in the loop and then calling the REST action after the loop, I would expect it to only have the most recently assigned value, so that seems right to me. If you need to do the REST action for each item in the array, then that action should be in the loop. Perhaps you could post a screenshot of the setup and what data you are unable to access?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2023 01:20 PM
So I have four variables in my mrvs set, the request body in my REST step will consist of four arrays containing a specific variable's answer in each row. For example if I had a variable with the Question 'what's your name' and two people filled out the same form and on the first row the answer would be "Mike" and on the second row "Emily", my request body would contain { "names": ["Mike", "Emily"]. So in the For Each flow logic I have an action that is pushing the answers to an array and then I'm setting the outputs to Flow Variables. After the loop I have the REST Action and I pass in the flow variables and the problem is that I'm only getting the data from the last row since it was the last iteration of the loop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2023 06:10 AM
I think I understand what you are saying. Again, a screenshot would or two would be helpful. But here's an idea that might help.
If your flow variable is a string, it seems like you could append the new information from the loop to the existing variable. Your REST action could take this series of strings and pack that into a single JSON body as needed.
 
 
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2023 06:31 AM
Thank you for your responses Michael, I ended up figuring it out. I scripted my own loop instead of using the For Each flow logic and that worked since now there's just one main branch.