How to trigger Line-manager approval from a variable in Service Portal

alejandro1984
Kilo Explorer

Hello,

I am very new to ServiceNow and this community which I found it quite awesome but I haven't been able to find the exact article for my inquiry.

I have created an Item in the Service Portal that will replace a paper form that we currently have. REQUESTED FOR: variable is refered to sys_user table with the purpose of users(Managers) requesting this form on behalf an other user. So I would like the Line Manager Approval to be triggered from the user selection of this variable rather than from the user who is signed into their ServiceNow session

find_real_file.png

In the approval box I am able to select a 'Requested for' as indicated below in yellow. The problem is that that is NOT the name the variable I created in my item which is 'requestedfor'. find_real_file.png

find_real_file.png

This below one is NOT the one I need because it gives me the Line Manager of the person who is logged in SN no from the variable 'requestedfor' from the item created in the Service Catalog.

find_real_file.png

find_real_file.png

1 ACCEPTED SOLUTION

Hello Alejandro,



Is the issue resolved now?


View solution in original post

4 REPLIES 4

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Alejandro,



Go to the approval user activity on the workflow and click on the advanced checkbox with the script as


var answer = [];


answer.push(current.PASS THE EXACT NAME OF REQUESTED FOR VARIABLE NAME HERE.manager.sys_id);


Hello Alejandro,



Is the issue resolved now?


It is thank you very much for your prompt response


You are very welcome Alejandro. Thanks for participating in the community!