Trigger approval through workflow script to a group which is present in a custom table

1_DipikaD
Kilo Sage

Hi All,

 

I have a custom table called portfolio which contains a field approval group which refers to group table. Also i have a catalog item which has a variable (reference type) which refers to Portfolio table. So i want when i select any Portfolio record in the catalog variable approval should go to the particular group which is present in that record. There is a existing approval group activity in workflow through which multiple approvals are getting triggered . So from there i need to trigger the approval to the groups.

 

Please let me know if more info is needed.

 

Thank you

 

8 REPLIES 8

Brad Bowman
Kilo Patron
Kilo Patron

What does the existing Approval - group script look like?  When this portfolio variable is populated, do you want to add the related approval group to any existing approvals, or replace any existing approvals with the portfolio related group? 

Exactly u r right. No need to replace any existing approvals an additional approval will go to the related portfolio group

The Approval - Group workflow activity has a script where you are or can push a group sys_id to the 'answer' array.  If you already have a script, you can just add another line like

answer.push(current.variables.portfolio.approval_group);

where 'portfolio' is the variable name and 'approval_group' is the name of the field on your portfolio table which is a reference to the sys_user_group table.

 

If you don't yet have a script and the existing approvals are via the Groups list field, you can try checking the Advanced box to add a script for this approval.  If you're not getting both/all groups, you may need to also push the sys_ids of the groups listed in the Groups list field to the script.

BradBowman_0-1729618339262.png

 

Yes I have an array so I added this line and tested but failed to get result.