Flow designer For each loop ask for approval
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2023 01:41 PM
I'm having an issue getting an ask for approval action within a for each loop to work. Within a flow I've created, I'm calling a custom action that is returning an array of sys_user_group sys_ids. I want to loop through the array and ask for approval from each of the groups. Within the for each loop, I'm setting a flow variable to one of the sys ids from the array. This is getting set correctly. Then I'm using a scripted rule within the ask for approval action
var groups = fd_data.flow_var.group_sys_ids;
return "ApprovesRejectsAnyG["+groups+"]";
I can see in the execution results that the flow variable is getting set to one of the group sys_ids and the approval rule is pulling in that sys_id. But the approval records aren't getting inserted and the Approval state says skipped.
Can someone provide guidance on how I can get the approval to trigger for each group?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2023 01:53 PM
I am not sure what's going on. But can you add to line 7 below and try
var groups = your variable + "";
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2023 02:03 PM
Thanks for the response, I've added this but got the same results
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2023 09:02 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2023 06:21 AM
Tai Vu, thanks so much for the response. I ended up having to go a different route as I was under a time crunch.