Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2025 05:42 AM
since you only want 100 records, please use setLimit()
var shortDescription = "Discuss New Hire's Career Journey";
var gr = new GlideRecord('incident');
gr.addQuery('short_description', 'LIKE', shortDescription);
gr.setLimit(100);
gr.query();
var sysIds = [];
while (gr.next()) {
sysIds.push(gr.getValue('sys_id'));
}
gs.info('Sys IDs: ' + sysIds.join(', '));
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards,
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader