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

It would really help if you shared your script.

SAI VENKATESH
Tera Sage
Tera Sage

Hi @1_DipikaD 

You can try the below script:

var portfolioSysId = current.variables.portfolio_variable_name;

var portfolioGR = new GlideRecord('portfolio');
if (portfolioGR.get(portfolioSysId)) {
    var approvalGroup = portfolioGR.approval_group; 
    current.approval_group = approvalGroup; 
}

 

Thanks and regards

Sai Venkatesh

No doesn't work  and not sure why you put current.approval_group = approvalGroup;

Hi @1_DipikaD 

 

You can check the below Script:

 

answer=[];
answer.push(current.variables.variable_name);

 

I have tested in my PDI and it is working Fine.

 

Thanks and Regards

Sai Venkatesh