The CreatorCon Call for Content is officially open! Get started here.

Manual Approval - Without Updating Flow Designer

Manal  AQUIL
Tera Contributor

Hi Community Members, 

 

Kindly, help me solve below scenario:

 

Scenario: We have an RITM/ Change where approvals have already been triggered for certain people. Now,  we want to add additional approvers  or update existing  approvers.

 

Solution: 

1. I tried to add Manual Approver (Users) in approval action activity in flow designer. This enabled that whenever an existing RITM or CHG will get new approval inserted then that approval record will also get tagged to flow context and hence approval of the newly inserted approver is also required.  But this solution will require a lot of manual work if I want this manual approver functionality for more than 150 Flows .Hence, I want a generic solution.

 

2. So as a second solution, I tried to create a UI action on task table (so the button will be visible on RITM/ CHG) i.e when button is clicked on RITM then it will update the existing approver attached to RITM and since existing approval is updated and hence flow context also doesn't break . But this solution only worked when I tried as an admin User and doesn't work for non admin user .

 

Kindly, suggest a feasible solution so that I can update or insert new approval to RITM or CHG and upon approved by new approver the flow should move forward (without breaking flow) . 

 

Thanks,

Manal Aquil

8 REPLIES 8

TejasSN_LogicX
Tera Contributor

You don’t need to hard-code manual approvers in 150 flows. The best practice is to build a generic subflow or scripted action that inserts approvers into the sysapproval_approver table and links them to the RITM/CHG. Since Flow Designer monitors that table, the flow context will stay intact and move forward when the new approver acts. This way, you maintain only one reusable logic instead of editing every flow.

If you still want a UI Action for manual updates, it must be fixed for non-admins by adjusting ACLs on sysapproval_approver or by running the script with elevated permissions. But overall, using a reusable subflow or action is the cleanest and most scalable approach

Thanks for responding @TejasSN_LogicX 

Thanks for responding @Ankur Bawiskar 

Even If create a subflow or scripted action I will need to call this subflow in 150 existing flows  . 

I need generic solution so that I should not update any existing flow

@Manal Aquil ,

You’re correct — calling a subflow in 150+ flows means touching each one, which isn’t practical. If you want a truly generic solution without modifying existing flows, the best approach is to work directly at the sysapproval_approver level.Whenever you insert or update approvers in that table, the flow context remains intact. So, instead of embedding logic in every flow, you centralize it.

Create a Business Rule on sysapproval_approver (generic, works for RITM/CHG):

Table: sysapproval_approver

When: Before Insert (or Before Update, depending on need)

Condition: Check if the record is linked to an RITM (sc_req_item) or Change (change_request).

Script: Dynamically insert or update additional approvers based on your business rules.


(function executeRule(current, previous /*null when async*/) {
try {
// Example: iif approval is on RITM and some condition matches
if (current.sysapproval.getRefRecord().getTableName() == 'sc_req_item') {
// Add extra approver dynamically
var newAppr = new GlideRecord('sysapproval_approver');
newAppr.initialize();
newAppr.approver = 'user_sys_id_here';
newAppr.sysapproval = current.sysapproval;
newAppr.state = 'requested';
newAppr.insert();
}

// Similarly you can handle Change (change_request)
} catch (ex) {
gs.error('BR Error adding approver: ' + ex);
}
})(current, previous);


or else you can try this
UI Action for manual insertion (generic button):

Add a button on RITM/CHG that lets you insert approvers manually.

Script in UI Action should call a Script Include that inserts approvers into sysapproval_approver.

For non-admin users, wrap the script in GlideSystem APIs with Elevate Role or fix ACLs on sysapproval_approver.

 

 

 

thanks

 

How this subflow will be linked to main flow. Because we want once newly inserted approval is approved then main flow should move forward ??