- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 11:20 AM
In Server side background script how to query glide record ... Sys Id is not ..
Below query is not working
var rec = incident.sys_id ( stored incident sysid records)
addQuery('sys_id , '!=', rec);
ANY IDEA
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 11:59 AM
Hi @sukran,
Use the following query instead:
addEncodedQuery('sys_idNOT IN'+rec);
I am assuming the 'rec' variable is an array which stores the sys_ids.
Cheers

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 12:30 PM
Did you also debug exit.trigger_id, does it contain the value you would expect?
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
03-26-2024 12:34 PM
exit.trigger_id = returns sys id as expected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 11:59 AM
Hi @sukran,
Use the following query instead:
addEncodedQuery('sys_idNOT IN'+rec);
I am assuming the 'rec' variable is an array which stores the sys_ids.
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2024 09:43 AM - edited 03-27-2024 09:45 AM
Its works with mentioned code
var usrLoc=[];
addEncodedQuery("sys_idNOT IN"+usrLoc);
Passing the value to array ,then its looks good

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 12:01 PM
It should be able to work. The other suggestions are fine to. Question is more, is the other content in your query valid, did you verify? For example "rec", is that valid? Did you debug?
What can you share.
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field