Flow Designer 'Ask For Approval' action script requires multiple approvals from 2 Flow Variables

terryreints
Tera Contributor
We are on Utah. This script is not working for me.
I'd like to just do parallel approvals for the 2 fields, but apparently that doesn't work.
Can I combine approvals with an 'and', as in 'AndApprovesAllU' or 'AndApprovesAnyU'?
 
I need to require approval from ANY of several user sys_ids in flow variable project_approvers_1.
AND also require approval from ALL of several user sys_ids in flow variable project_approvers_x.
Reject this approval if any of the users reject it.
 
var approvers = fd_data.flow_var.project_approvers_1 + ',' + fd_data.flow_var.project_approvers_x;
return 'ApprovesAnyU[' + fd_data.flow_var.project_approvers_1
+ ']AndApprovesAllU[' + fd_data.flow_var.project_approvers_x
+ ']OrRejectsAnyU[' + approvers + ']';
1 ACCEPTED SOLUTION

Shruti Khaire
Kilo Sage

Hello @terryreints,

 

Can you try this using the following steps:

There are times when we need to do parallel approvals on the same record, but this isn't supported within Flow Designer.  The typical pattern instead is to create a subtask and create approvals on the subtask.

To do this:

  1. Add Do the following in Parallel Flow Logic
  2. Create a subtask, but adding Create Task to each branch (Create Catalog Task for Service Catalog flows)
  3. Be sure the Wait Checkbox is unchecked 
  4. Add Ask For Approval to each branch and use the Task record created in (2) as the record for approval
  5. You may want some logic to close the subtasks once approved

ShrutiKhaire_0-1696916211077.png

 

Hope it helps, Thank you!

 

View solution in original post

3 REPLIES 3

Shruti Khaire
Kilo Sage

Hello @terryreints,

 

Can you try this using the following steps:

There are times when we need to do parallel approvals on the same record, but this isn't supported within Flow Designer.  The typical pattern instead is to create a subtask and create approvals on the subtask.

To do this:

  1. Add Do the following in Parallel Flow Logic
  2. Create a subtask, but adding Create Task to each branch (Create Catalog Task for Service Catalog flows)
  3. Be sure the Wait Checkbox is unchecked 
  4. Add Ask For Approval to each branch and use the Task record created in (2) as the record for approval
  5. You may want some logic to close the subtasks once approved

ShrutiKhaire_0-1696916211077.png

 

Hope it helps, Thank you!

 

terryreints
Tera Contributor

Shruti,

 

That worked! Thank you for your assistance.

Terry

 

No worries Terry,

 

Happy to help, thank you!