For Each Flow activity question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2025 06:58 AM
I have a question on Flow For Each activity.
I have a use case where I'm ordering user access to specific Cloud applications or software installations.
So far, each cat_item has only required that a user be added to a single AD Security group
Using the AD Integration Hub spoke, we've been very successful in adding users to the security groups up to now. Part of the Flow uses a Decision table (referencing the cat_item) to pull what AD Group is required.
Now I've just received a request where access an application requires 2 security groups.
Well that is not were the issue lies. By using a For Each activity, i am successful getting the user into each group for 2 or more returned records. But when the application only has one record, the Add to AD Group activity does run.
I retested this by adding a second group, and it worked.
Any suggestion on how to account for records that only have 1 returned decision vs multiple?
Here are my flow activities:
Please let me know if i forgot to include something.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2025 09:40 AM
Hi @EricG2 ,
You need to force the result into a list/array every time, even if it’s just one record.
Use “Get Records” before the loop. Instead of directly looping over the Decision Table output:
Capture the AD group name(s) from the decision table. Use Get Records action (filter by those names) to retrieve them as a record list. Feed that list into the For Each.
Wrap single value in a list
If you’re working with a Data Pill from the decision table:
Create a List Collector-style Data Pill variable or script step.
In a small inline script step before the loop and pass it to your ForEach.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2025 08:12 AM
@pavani_paluri I'm assuming that this would be a Custom Activity and not something OOB.