For Each Item flow logic how to get the consolidated output
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2020 08:03 PM
while creating a record I need to get related list of records and perform a REST action for each record . I'm using this flow and its working fine however I've no idea how we can get the final output to a variable.
Basically each REST response will return an unique reference and I wanted to update the concatenate value of response to a field in the table.
jamsheer
- Labels:
-
flow designer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2020 12:10 PM
I tried this before and only got the value of the last element in the loop as a "concatenated value".
It seems like I would have to input the concatenated value from the previous loop as an input to the concatenation step. How do I get the output parameter the concatenation script as an input parameter so the values will be concatenated?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2020 07:04 PM
When I tried this before I was unable to use the 'sumoutput' in the Update Record step and I was only able to get the last iteration record.
Whats the content of your script to concatenate value action?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2021 05:14 AM
Hi Jamsheer,
I believe this is addressed in Quebec with the introduction of the flow variables, More details here - https://developer.servicenow.com/blog.do?p=/post/quebec-fd-whats-new/
You can store the values in flow variables without updating in records and use it finally.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 07:48 AM
- Create a flow variable 'response'.
- Add new step under rest inside for each loop to set the flow variables.
- Select the flow variable created and use below script inside it,NOTE : fd_data._2.1_REST_CALL have to be checked with your flow and &&& is used as separator for multiple responses.fd_data.flow_var.response += fd_data._2.1_REST_CALL + '&&&';return fd_data.flow_var.response;