REST API for user criteria validation -- catalog items
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2022 10:42 PM
Dear members,
Good Morning!
I am working on integration where I am receiving user's 'sys_id' and catalog item's 'sys_id' in request body. The requirement is evaluate user criteria for the user against the item received in request body and return 'true' & 'false' in response body.
Could someone please let me know if any OOB API available for the same which can be utilised.
I am aware of 'GlideappCatalogItem' API which can be used as 'GlideappCatalogItem.get('catalog item sys_id').canView(); however it works only for logged in user.
Many thanks.
Best Regards,
Naveen

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2022 10:48 PM
Hi,
Please check below links, you can check user criteria by script.
https://community.servicenow.com/community?id=community_blog&sys_id=15df9936dbe001143dd13ca8f49619bb
Thanks,
Anil Lande
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2022 11:14 PM
Hi
Thank you for your swift response. I have gone through provided articles but it didn't help much.
I have similar required as in below thread. I want to check access to a catalog item for a specific user.
https://community.servicenow.com/community?id=community_question&sys_id=ffeca1c51b59d950b3b911f8b04bcb77
Best Regards,
Naveen

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2022 06:15 AM
Hi,
The link you shared above is refers to this question only.
If you have user criteria applied on your catalog item then you can check it like below:
var userCriterias = ['6b6df061ff2121009b20ffffffffff44','0b5b0e6453631300afffddeeff7b1201'];
var userMatches = sn_uc.UserCriteriaLoader.userMatches(gs.getUserID(), userCriterias);
gs.info(userMatches);
In Above script replace sys_id of criteria and user sys_id who is making request.
It will not work as it is and you need to use above script as per your requirement.
Thanks,
Anil Lande
Thanks
Anil Lande