We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

how to fetch location details from one table to location reference field

saanvitha
Tera Contributor
 
3 REPLIES 3

omkar_jadhav_
Tera Contributor

Hi @saanvitha 
You can achieve it by Dot Walking
Imagine a table (e.g., Incident) with a location reference field. Dot walking lets you reach details from the referenced table (e.g., cmn_location) like this

dgarad
Giga Sage

Hi @saanvitha 

 

we can use Dot walking as

 

user.location.country_field.getDisplayValue();//to get the value of the field

or

user.location.country_field.getValue();//to get the sys_id of the field
If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad

swathisarang98
Giga Sage

Hi @saanvitha ,

 

Could you please explain a bit more about your requirement, what exactly are you trying to achieve ?

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang