How can we automatically populate the Site field value based on the Caller field.

Ria
Tera Contributor

How can we automatically populate the Site field value based on the Caller field for a specific catalog item?

Currently, both the Caller and Site fields are populated automatically. However, if the caller's name is changed, the site value does not update accordingly.

25 REPLIES 25

@Ria 

No fresh variable required.

Simply use existing "Request on behalf of this user" variable and use that to auto populate the Site variable

Auto-populate a variable based on a reference type variable (Utah) 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Ankur Bawiskar 

 

No existing variables are there when I click on the dependent question for the site variable. You can refer to above screenshot.

 

@Ria 

 

Only reference type variables will come up there.

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

@Ria 

"Request on behalf" variable should be Reference type then only Auto populate feature will work

you already told it's reference type so it should be shown

If not then make it reference to sys_user

AnkurBawiskar_0-1744190406876.png

 

In the Site variable select "Dependent question" -> Request on Behalf

Then In "Dot walk path" -> Select Location field

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi @Ankur Bawiskar 

 

The request on behalf of this user is for a reference field created on the user table, and the site is also a reference field but created on the location table. If I change the site reference table to user, then it's working fine but impacting other fields. Could you please let me know if we can achieve this using a script?