Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

ASK FOR APPORVAL LOGIC FALURE

naresh59
Tera Contributor

Hi Team,

I am facing an issue with the **Ask For Approval** step in Flow Designer when dynamically generating approvers through a Script Step.

**Requirement**
We have a catalog item where multiple owners are selected in a variable. Based on certain conditions (grade, VIP, etc.), we determine which users should receive approval. All selected valid owners must receive an approval request, and the flow should wait until **all approvers approve**.

**Current Implementation**

1. A **Script Step** is used before the Ask For Approval action to determine the list of approvers.
2. The script evaluates the `certain feilds variables and checks the owner grade from the `hr` table.
3. The script builds a dynamic approval rule and returns it as output.

Example output from the script:

ApprovesAllU[sys ID,sys ID,sys ID]

This value is passed to the **Ask For Approval → Rules** field using a data pill.

**Observed Behavior**

* The Ask For Approval step creates all approval records correctly.
* Three approval records are generated.
* However, when the **first approver approves**, the flow continues to the next step.
* The remaining approvers automatically become **No longer required**.
* The flow does **not wait until all approvers approve**, even though the rule is `ApprovesAllU`.

**What I Have Verified**

* The rule format is correct (`ApprovesAllU[user1,user2,user3]`).
* The script output is populated correctly in the flow execution details.
* Approval records are generated successfully in the `sysapproval_approver` table.

**Expected Behavior**
The flow should wait until **all approvers approve** the request before moving to the next step.

**Question**
Is there any additional configuration required in the **Ask For Approval** step to ensure the flow waits for **all approvers**, or is there a better approach to dynamically pass multiple approvers from a Script Step?

Any guidance would be appreciated.

0 REPLIES 0