- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2025 08:10 PM
Is this possible to filter the field of reference sys_user into same Region of Requested For ?
Unfortunately this ain't work.
Sample Script:
Script Include:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2025 08:53 PM
The link I shared shows how to perform the recursion to get all the values in that hierarchy, simply enhance it for location.
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2025 08:35 PM
Hi Jeck,
If I understood your request properly, you don't necessarily need to write a script.
You can use reference qualifiers to achieve this.
Please refer these links:
1. Product documentation: https://www.servicenow.com/docs/bundle/yokohama-platform-administration/page/script/server-scripting...
2. Community link: https://www.servicenow.com/community/developer-articles/reference-qualifiers-in-servicenow/ta-p/2765...
Please mark this as helpful and correct if this helps you,
Thanks,
Yaswanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2025 08:40 PM
I have tried it already by just doing this simple script , unfortunately it will only get the location not the Region which i tried.
Location>Parent>Parent then script is javascript:gs.getUser().getLocation().getParent().getParent()
javascript:gs.getUser().getLocation()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2025 08:45 PM
this one it will only populate all record that has same location with logged on user. but in my case is i need to dotwalk into location.parent.parent so i will get the Region.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2025 08:51 PM - edited 06-01-2025 08:55 PM
Hi Jeck,
So here in Location filter, instead of using gs.getUser and location use a script include and define your condition inside script include to only get those values.
Go with advanced reference qualifier and pass the current.Location>Parent>Parent to script include and use it to filter to only get those values.
This approach will work for you.
Thanks,
Yaswanth.