Parallel Group Approvals from List Collector in Flow Designer Not Working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi everyone,
I'm working on a Service Catalog flow in Flow Designer triggered by a Requested Item (sc_req_item). Here i want to get the parallel approavls from the approval groups .I have a List Collector variable called related_services that stores multiple related services (cmdb_ci_service records). Each service has a reference to an approval group in the change_control field.
In my flow, I use a script to collect all the approval group sys_ids from the related services and pass them to the "Ask for Approval" action. Here's the script I'm using:
and in Ask for Approval i am setting this
and i my flow execution i am getting as approval as skipped
Note:Here i want to sent the approval to approval groups parallel
Help me to overcome this issue
Thanks in Advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
not very sure then
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @LokeshwarRV ,
I think your flow variable is of type string and you are returning array.
Update your return statement as:
return groups.join();
Thanks
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Anand2799,
I’m now receiving the group approvals as expected. However, I’ve noticed an issue:
When any one person from any group approves, the system is marking all groups as "no longer required."
This is problematic because we’re aiming for parallel approvals, where at least one person from each group must approve before the process can move forward.
Could you please help check the logic or configuration? Ideally, the workflow should wait for one approval per group, not just any single approval across all groups.
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @LokeshwarRV ,
Parallel approval are always difficult to implement.
As you are using dynamic approvals you need to use script for rules, follow the below steps to build out query for rules:
From Ask for approval action remove selected value from Approval Field.
for rules select script toggle.
Write below script:
var groups = '287ee6fea9fe198100ada7950d0b1b73,82f0551f535913004e77ddeeff7b12d3,404cedd5930112003b4bb095e57ffbf4';
var rule = '';
if(groups){
// Approve rule
var groups_arr = groups.split(',');
//First group
rule = 'ApprovesRejectsAnyG[' + groups_arr[0] + ']';
//for other groups
for(var i=1; i<groups_arr.length; i++){
rule+='&AnyG[' + groups_arr[i] + ']';
}
// Reject rule
rule+='OrRejectsAnyG[' + groups + ']';
}
return rule;
Adjust your script as required and refer your variable for groups, my script waits for one user to approve from every group and whenever someone rejects form any of the group it will reject the approval without waiting for any other group.
Follow this article for building scripted approvals:
Thanks
Anand
