approvals based on variable (referrence field)

Anubhav Srivas1
Tera Expert

Hi Experts,

 

based on the Divison selected , i.e. a (reference field) from the department table, I want to trigger approvals based on the below selections. I'm not able to achieve it and require your help in creating a workflow that checks the current value of the division ( which is fetching from department table) and trigger approvals accordingly.

 

the conditions are as follows: 

DivisionLEVEL 1 APPROVERLEVEL 2 APPROVER
Australia CommercialLine Manager( of the requester)Approval Group Name: Australia Commercial BCD
Australia RetailLine Manager( of the requester)Approval Group Name: Australia Retail BCD
Corporate Centre and ServicesLine Manager( of the requester)Approval Group Name: Corporate Centre and Services BCD
Group ServicesLine Manager( of the requester)Approval Group Name: Group Services BCD
Group TechnologyLine Manager( of the requester)Approval Group Name: Group Tech BCD
InstitutionalLine Manager( of the requester)Approval Group Name: Institutional BCD
New ZealandLine Manager( of the requester)Approval Group Name: New Zealand BCD
PacificLine Manager( of the requester)Approval Group Name: Pacific BCD
Technology COO DomainsLine Manager( of the requester)Approval Group Name: Technology COO Domains BCD
10 REPLIES 10

Ravi Chandra_K
Kilo Patron
Kilo Patron

You have to write two approvals. One is approval user and the other approval group. In each approval workflow activity, select advanced and write approval script.

You can write approval script like this;

answer = [];

If(current.variables.division = "pacific") //you can access variables by current.variables).

answer.push(current.variablesubject_person.manager);

 

Refer below link for approval group scripting.

https://www.servicenow.com/community/developer-forum/dynamic-approval-group-scripting/m-p/1507572/pa...