Default Phone Variable Value

akunk23
Kilo Contributor

Hello

Right now, when a user opens a service request, the form auto populates the phone number with the logged in user. I want the phone variable to be based off of the "requested for" variable. How would I go about doing this? Here is the script in the default value for the phone variable.

find_real_file.png

I'm not sure I'm wanting to actually get the userID? I may be wrong though. Thank you

13 REPLIES 13

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello,



Remove 2nd line and replace 4th line with user.get(current.request.requested_for); and try once.


Phone number shows up blank. The actual request for variable is "Requester". I adjusted your script with that and still nothing


Madhu27
Tera Expert

Use phone = current.request.requested_for.phone


akunk23
Kilo Contributor

Thanks for the response, however, phone number shows up blank now