Flow Designer and scripting Ask for Approval

david_legrand
Kilo Sage

Hi community,

Has anyone tried to use the "scripted rules" on the Ask for approval? Because my flow won't be as simple as "take a user in a predefined field"...

I can't find what the rule is expecting 😕

find_real_file.png

1 ACCEPTED SOLUTION

Thanks, We just had to learn to create subflows/actions for everything we needed to have.

I'll use Flow but I still like Workflow for its responsiveness and easiness to script... 🙂

View solution in original post

10 REPLIES 10

Chiranjeevi Go1
Giga Expert

Hi David, 

Have you figured out how to script for Ask for approval action to get the approvers using the script?

I have a requirement to pull the approvers from a custom table and not sure how to script in the ask for approval action. 

Thank you.

JC Icaro1
Kilo Guru

In case this helps someone, I think you need to test the flow and look at the Runtime Value to determine what needs to be returned by the script. In my example below,

find_real_file.png

 

Here's the script I used:

find_real_file.png

When I tested this, it created sys_approval records for the users with those sys_ids.

Thank you, it helped!

how about for Groups ?

For multiple groups approval, you can use multiple "Anyone approves" in an OR condition. Connected to one "Anyone rejects" containing all groups needed.

find_real_file.png

For dynamic group approvals, check runtime value of flow context of the above and script the approval condition to return a string like:

ApprovesAnyG[groupSysID1]&AnyG[groupSysID2]&AnyG[groupSysID3]OrRejectsAnyG[groupSysID3]

find_real_file.png