Visiblity of the catalog items for all users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 09:46 PM
Hi All,
I have a requirement where a particular catalog item needs to be visible to all users , We have also written this code in "available for" section .
But still users with the snc_internal aren't able to see the catalog item in the portal. How to achieve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2024 01:41 AM
On the advance condition in the scripting just for one line as :
answer = true;
See if it helps...
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2024 01:45 AM
Or ! @phr
Try this solution in the KB for snc_internal role: skip / modify necessary steps.
- Navigate to any Out of the box Instance
- If snc_internal and snc_external roles are not added to instance, install the "Explicit Roles" plugin. Refer to "Explicit Roles" documentation for more information
- Once plugin is installed. Create new user or edit roles for an existing User so User has only snc_external role - This is for testing purpose.
- Navigate to service portal ➔ homepage. For Out of the box it is index page.
https://<your-instance>.service-now.com/nav_to.do?uri=sp_page.do?sys_id=46cc384147532100ba13a5554ee49009 - Give snc_external role to page.
- Go to sc_cat_item page and give snc_external role to page.
https://<your-instance>.service-now.com/nav_to.do?uri=sp_page.do?sys_id=9f12251147132100ba13a5554ee490f4 - Go to widget SC Catalog Item and give snc_external role to widget
https://<your-instance>.service-now.com/nav_to.do?uri=sp_widget.do?sys_id=3c29786e87133200e0ef0cf888cb0bdf - Open your Catalog item for ex. Apple ipad 3.
- Add related lists "Available for " and "Not available for".
- Go to "Not available for" related lists and edit it. Remove SNC External.
- Go to "available for" related lists and edit it. Add SNC External.
- Login as External User created in step 3.
- Go to Service Catalog and browser by category - Apple ipad 3 will be available for user.
- Same steps can be followed for any record producer.
Note: If your record producer is calling any script include then separate ACL should be added so external users can pass and access script include so functionality works as expected.
If ACL is not added or respective ACL are failing then there will be console errors and debugging logs will show which ACL is failing.
REF:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0728420
I hope it helps...
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2024 01:23 AM
@phr There is no hasRoles method instead you need to use hasRole. Please update your code as follows.
if(gs.hasRole('snc_internal')){
answer=true;
}
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2024 01:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2024 01:55 AM
Hi @phr ,
Test with any other catalog item in your instance . In your instance is any catalog item made available to all users?Then compare your catalog item with it.
If no catalog item is visible to all users then probably it has to do something with your widget in portal. There the items might me hided with role
Check and let me know
Please mark my answer correct/helpful if it resolved your query