- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2019 09:48 PM
Hello,
I'm working on a flow and I have a problem understanding the approval logic logic when used in a For Each loop action.
I have a record producer (on the 'facilities_request' table) with a list collector variable which contains a list of locations (reference to the 'cmn_location table').
In the catalog form, the user can select locations for which he wants an access to granted on his employye card. When the request is created a task is created for each location and an approval is sent to the location owner to approve or not the access.
1- My first step is to get the selected locations in the variable. I'm doing this by a custom script action and I output the sys_id of each locations.
2- Then I look up for each record on the 'cmn_location' using those sys_id.
3- Then I use a For Each loop action to create a facilities task for each location access.
When I'm doing this and test it everything is fine and I get one task for each location selected.
However when I include a 'Ask for approval' action after the task creation, there is only the first task that is created with the correct approver but the other tasks are not created.
The approval on the first task needs to be approved/refused and only then the second task is created with the correct approver and so on.
My goal is to create all the tasks with the approvals at the same time.
Anyone can help me?
Thank you
Solved! Go to Solution.
- Labels:
-
flow designer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2020 09:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2019 09:12 AM
I have this exact same problem.. Also looking for an answer to this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2020 09:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-18-2020 06:41 AM
Hello ServiceNow Technical Support,
I created a Case on HI and a support engineer worked with me on my use case and problem and it resulted that this is not acheivable with Flow Designer.
The KB your are refering to is for the action 'Do the following in parallel' and it does not apply for what I'm trying to acheive.
Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2021 08:00 AM
Late reply, but just ran into the same problem. A workaround is to create the tasks only in the For Each loop, then call a Sub-Flow to create the approvals.
Importantly ensure 'Wait For Completion' is false in the sub-flow.