- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2019 03:58 AM
in below argument condition i want to add "^Location in ( gs.getUser().getLocation())"-- user can have multiple Location.please suggest correct syntax
&sysparm_fixed_query=sys_created_by=javascript:gs.getUserName()^company=javascript:gs.getUser().getCompanyID();
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2019 04:08 AM
&sysparm_fixed_query=sys_created_by=javascript:gs.getUserName()^company.sys_idINjavascript:gs.getUser().getCompanyID();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2019 04:05 AM
Hi there,
You could simulate your encoded queries thru for example:
This will give you an example query, which will give you the pieces you are after 🙂
sys_idINa,b
In this case you are after the IN statement I guess.
This one isn't that hard of course. Though building your queries like this could help with more complex things, like date calculations, etc..
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2019 04:08 AM
&sysparm_fixed_query=sys_created_by=javascript:gs.getUserName()^company.sys_idINjavascript:gs.getUser().getCompanyID();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2019 06:00 AM
//try
&sysparm_fixed_query=sys_created_by=javascript:gs.getUserName()^company=javascript:gs.getUser().getCompanyID()^location.sys_idINa,b
a and b are the sys_ids of the location
you can have a script include that returns a list of sys_ids of locations
&sysparm_fixed_query=sys_created_by=javascript:gs.getUserName()^company=javascript:gs.getUser().getCompanyID()^javascript: new GetLocations().getUserLocation();
Vinod Kumar Kachineni
Community Rising Star 2022