Flow Designer: “All must approve” & “anyone rejects → RITM rejected” using ApprovesAllU[...]

BiswalNayak
Tera Contributor

var approvers = fd_data.flow_var.groupmanager; 

return "ApprovesAllU[" + approvers + "]";

 

This correctly enforces all approvers must approve before proceeding. I also need: if anyone rejects, the flow should go to the reject branch and reject the RITM. Here the reject branch is not working. So, what is the solution to work both of the conditions ?

1 ACCEPTED SOLUTION

Anand2799
Kilo Sage

Hi @BiswalNayak ,

 

You can configure this as per the below screenshot:

Anand2799_0-1768233333882.png

 

Or if want to use script:

"ApprovesAllU[" + approvers + "]OrRejectsAnyU[" + approvers + "]";

 

Thanks

Anand 

View solution in original post

5 REPLIES 5

Anand2799
Kilo Sage

Hi @BiswalNayak ,

 

You can configure this as per the below screenshot:

Anand2799_0-1768233333882.png

 

Or if want to use script:

"ApprovesAllU[" + approvers + "]OrRejectsAnyU[" + approvers + "]";

 

Thanks

Anand 

nayanmule
Kilo Sage

Hello @BiswalNayak  ,

This can be handled using Approval/ Rejection rules in the flow designer. Why to go with coding ? 

It's always recommended to minimalize the use of code especially while using flow designer.

nayanmule_0-1768235423733.png

 

 

Regards,

Nayan

If my response has helped you, kindly mark it as helpful and accept the solution.

Thank you for your response, Nayan. I completely agree that minimizing code in Flow Designer is the best practice.

In my case, the challenge was that the variable I’m using is a List Collector that stores selected groups. The requirement is to send approvals to the managers of those groups, but Flow Designer doesn’t directly resolve group managers from a list collector variable. Because of this, I had to use a script to dynamically build the approval rule string (ApprovesAllU[...]) with the user sys_ids of those managers.

BiswalNayak
Tera Contributor

This code is working fine. Thanks @ Anand2799 for your quick response.