how to add approver in workflow depending on selection of user of a field

aritra23
Kilo Contributor

how to add approver in workflow depending on selection of user for a field like lookup select box?

14 REPLIES 14

Chuck Tomasi
Tera Patron

Hi Aritra,



You need to checked the advanced checkbox in your User approval and use a script to get the value of the field. Let's call it a reference field "u_user".



The script might look something like this:



answer = [];



answer.push(current.getValue('u_user'));



// Untested


Reference:


http://wiki.servicenow.com/index.php?title=Approvals


how to know the name of the variable?


If it is a variable from a catalog item, you can find the name in the list of variables in that item.



If it is a field on a form, right click on the field label and look at the option "Show xxxxx". That will say the name of the field.


For example:


find_real_file.png


var k= current.getValue('fieldname') should return the value of the field right?