Dynamic approval for order guide based on custom table records through workflow script

1_DipikaD
Kilo Sage

Hi All,

 

I have an orderguide which contains 4 catalogitems . When i select 2 catalogitem suppose apple ipad3 and apple iphone 6s and then go to choose option. In that section there is a field called portfolio which is a reference field that refers to a custom table if you see in pictures. When a new record created an approval required from the group which is mentioned in that record. A workflow  got triggered when orderguide is requested and every time a approval request goes to a particular approval group which is mentioned in the script section of approval group activity in that workflow. But we need an additional approval request to  go to the group which is mentioned in approval group field in portfolio table records. 

 

For example:-If you see in the pictures suppose I select ipad3 and iphone 6s in Describeneeds Section and on choose Option section i select client server record which comes from a custom table called portfolio and then i submit request. One approval will go as usual but one additional approval also should go to service desk group as mentioned in the record of the custom table. Approval request to be triggered from the script of  approvalgroup activity of Workflow.

 

var appGrpId = [];
var requestType = current.variables.req_type;
if (requestType == "80f2c56edb2bba00c276f3b31d961977" || requestType == '33e0f7ccdbd083001ecdfb971d96198b')
 { 
if(current.variables.u_portfolio.u_approval_group != '')
{
appGrpId = current.variables.u_portfolio.u_approval_group.tostring().split(',');
}
 
    for (var i = 0; i < appGrpId.length; i++){ 
 
        answer.push(appGrpId[i]);
    }
 
}
 
Also I tried this script in workflow script of approval group activity but it is not working . Could you please suggest me any solution to achieve this ?

 

 

Thank You

@Ravi Gaurav  @Dr Atul G- LNG  @Sandeep Rajput 

2 REPLIES 2

Dr Atul G- LNG
Tera Patron
Tera Patron

Picture is missing.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Ohh sorry. I added the pictures.

Thanks for informing