- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2025 06:59 AM
Hi All,
I have created a system properties "a_b_c" where i have stored three sys ids of a catalog in form of a,b,c.
now this i have to use in business rule. when my catalog is any of this (a or b or c). then do xyz.
i have to put this sys property a_b_c in Encoded Query of a BR.
i have used but its not selecting that three catalog ids.
script:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2025 05:44 PM
Hi @PawanKumarR
Try below script..
var sysIds = gs.getProperty('a_b_c').toString();
var encodedQuery = 'cat_itemIN' + sysIds;
var ritmGr = new GlideRecord('sc_req_item');
ritmGr.addQuery("opened_by", current.getValue('u_owner_id'));
ritmGr.addEncodedQuery(encodedQuery);
ritmGr.addActiveQuery();
ritmGr.query();
while (ritmGr.next()) {
//YOUR LOGIC HERE
}
Hope this helps .
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 09:37 AM
so what debugging did you do?
if that property holds comma separated sysIds of catalog item (sc_cat_item) then this should work fine
var encodedQuery = 'cat_item.sys_idIN' + gs.getProperty('a_b_c');
ritmGr.addEncodedQuery(encodedQuery);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader