- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2024 06:34 AM
I need to fetch the location of the requester from the Incident table. I created the location field in the Incident table and would like to know if I can do this using the default value in the dictionary.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2024 10:11 PM
Hi @Leticiad ,
you can do with dot walking the User location field to avoid script like below
as you have Requested for as reference field to User
search your field click on '+' icon
then it will list all field of the User fields then find the location field
then save the form
if you select the Requested for then automatically location populates if user has location defined
for example
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Thanks,
BK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2024 10:11 PM
Hi @Leticiad ,
you can do with dot walking the User location field to avoid script like below
as you have Requested for as reference field to User
search your field click on '+' icon
then it will list all field of the User fields then find the location field
then save the form
if you select the Requested for then automatically location populates if user has location defined
for example
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Thanks,
BK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2024 10:20 PM
Hi @Leticiad you can do without script as well as @Bhavya11 mentioned and if you want to do with script I try on my PDI based on caller I do its working fine for script check below code. write onchange client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2024 10:32 PM
Hi @Leticiad ,
Dot walking change the actual value of requestor if user select other than default value mentioned on user profile. If your intention is to only show the requestor's location then do dot walking like below. Make this filed read only using ui policy.
And if you want to store as incident value then create new filed is the option and to set the value use below script in onchange client script
var loc=g_form.getReference('caller_id', LocName);
}
function LocName(loc) {
g_form.setValue("location",loc.location);
}
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2024 06:11 PM
Hi @Leticiad ,
Thanks for marking my solution helpful, now community enable multi acceptance feature so you accept multiple.