.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2025 05:10 AM - edited ‎07-09-2025 03:03 AM
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2025 05:45 AM
Always use IF while using get() method, reason being -> if record not found it will give you any non-matching glideRecord object as well
If it matches multiple, it gives any 1 record
I believe @Chaitanya ILCR already shared how it gets and which record it gets, sorted by A to Z
var gr = new GlideRecord('incident');
if(gr.get('category','inquiry')){
gs.info(gr.number);
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader