Update all the catalog items with new User Criteria
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2024 07:36 AM
Hi All,
Is there a way to add additional user criteria to all the catalog items? I find it that modifying this property for +400 catalog items would be to mundane. Any way to do it faster all at once?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2024 07:43 AM
HI @dev_K
There is no related list (M2M) which can be used to update all item in one go. You need to do manual way only.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2024 07:48 AM
@dev_K You can write a fix/background script to update the user criteria on the desired catalog items by making entries in sc_cat_item_user_criteria_mtom table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2024 07:49 AM
you can use background script for this and handle it
Something like this
var catItemSysId = 'sysId1,sysId2'; // give the 400 sysIds here as comma separated values
var arr = catItemSysId.split(',');
var userCriteriaSysId = ''; // give the sysId of the User Criteria here
for (var i in arr) {
var rec = new GlideRecord('sc_cat_item_user_criteria_mtom');
rec.initialize();
rec.sc_cat_item = arr[i];
rec.user_criteria = userCriteriaSysId;
rec.insert();
}
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2024 03:59 AM
Did my reply answer your question?
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

