- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 07:38 AM
I'm wanting to create a daily scheduled flow which will review active demand records and check to see if there is at least one active stakeholder assigned to the demand record.
Right now I have a look up action which conditionally pulls all the relevant records, however I'm unsure on the best solution to loop through each found record and see if the total number of active stakeholder records is <1.
I built a For Each flow logic but I can only see if the Stakeholder is Active or False, no way to get a total for Active Stakeholders.
Any help would be appreciated.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 10:15 AM - edited 06-14-2024 10:16 AM
I went ahead and mocked up the flow. The overall flow would look something like this, only using incident as an example.
Here is what your flow variable would look like
Here is setting the flow variable to 0
and you can update the count with something like this
here is where you can use that Flow variable to compare against
If you have any more questions, please let me know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 01:18 PM
Hi @Zach Koch,
I actually managed to fix the issue - turned out it was incorrectly looking up the demand stakeholder records and therefore the for each wasn't looping through records. Guess it was the wrong data_p*ll. I now have it incrementing correctly (basically if there is at least one active user then increment and if it is still 0 at the end then email a notice).
Will do a bit more fleshing out of the loop next week but fingers crossed, will be sure to mark your reply as the solution once it's wrapped up.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 01:53 PM
Great, glad that helped!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2024 01:16 PM
Hey @Zach Koch,
Wanted to pick your brain on this issue:
I have the flow finalized and it's working as intended except I can see a potential issue (see screenshot)
Essentially I have a nested For Each cycling through the Stakeholder Records for a given Demand Record. I want to see if any of the Stakeholder user records are active, if not, then send an email and inform them.
The issue I'm seeing here (circled in the screenshot) is that I think I'd need this If statement check to fully run against all the Stakeholders before hitting the second IF which sends out the email.
Otherwise I could see a scenario where the very first Stakeholder record has an inactive user, so it would send an email. However maybe there's a second Stakeholder record tied to that Demand and therefore shouldn't be an issue.
I feel that maybe the second IF should be moved outside the For Each in some way but not 100% (see arrow in screenshot)
Just curious on your thoughts regarding this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2024 01:38 PM
Yes I would recommend moving your second If statement to where you have indicated on the arrow. This will ensure that ALL stakeholders on the record are checked for active before the notification goes out. As you have it now you are correct, it could send it out if the first one was inactive, but the second one was active.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2024 07:17 AM
Hey @Zach Koch,
Modified the workflow and it's working perfectly. Greatly appreciate your help on this. I've accepted your original post as the solution since it resolved the initial issue.