Combined Queries in ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-06-2024 08:02 AM
How to write sysparm_query for the following condition?
FYI, I am using tables API
(sys_updated_on == $time AND sys_id = $id) OR (sys_updated_on > $time)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-07-2024 12:41 AM
Can you provide more information on your issue?
sys_updated_on == $time should be a single equals sign
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-21-2024 04:24 PM
Hi Kieran
We want to paginate on the table using sys_updated_on parameter.
Using sysparm_offset for pagination is not a good way, since deletes on the table will change offset indexing and can lead to records being skipped. And alone sys_updated_on is not a good option as well.
Hence, we want to use both sys_updated_on and sys_id for pagination, using this condition:
(sys_updated_on = $time AND sys_id = $id) OR (sys_updated_on > $time)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-24-2024 08:22 AM
This seems to differ to your original question. Can you explain in detail your issue and I can provide a more comprehensive answer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-24-2024 09:49 AM
@spgupta - If pagination needed via GlideRecord, then you may use "chooseWindow"
Sample
var in= new GlideRecord('incident');
in.orderByDesc('sys_updated_on');
in.chooseWindow(10, 20);
in.query();
while(in.next())
{
gs.log("Incident Number="+in.number)
}
Thanks,
Narsing