flow designer for each loop, how to add logic to close Request?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2021 07:01 AM
Hello,
I have a for each loop to add users to AD group, and that works fine.
However, I need to add logic to the flow, so the request is closed if users are added to ad group successfully.
It does not have to be all the users from list collector, but as long as some are added I want the request to be closed complete.
Now if i add the if logic to check if status was success within the for each loop then it will change the state of the request for each user it adds?
see my flow below, where I have moved the if step and update record step out of the for each loop...
, but here also it does not work. as the runtime value does not equate to success, but equates to {0}??? im not sure why this is, maybe because I am checking outside the for each loop?
ccan someone provide a suitable solution here please?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2021 02:52 AM
Hi,
what is that step 24 which will give you Success
Can you share that test step image
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2021 03:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2021 03:16 AM
Hi,
I believe you cannot access output of step 24 outside for each as it's context is within for each only
Possibly you will have to use some flag to hold the value when success set it with true
then check for this flag outside for each
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2021 03:23 AM
Thanks
thanks in advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2021 04:11 AM
Starting in Quebec a scratchpad has been implemented for flows in the flow designer. You should be able to use that to carry the value to step 24.
See documentation on flow variables here for details.