How to Hide catalog item on service portal based on users country
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 12:24 AM
Hi All,
I have an requrement where the catalog item should be hidden on portal if the currently logged in user's country is Finland . Any guidance will be helpful.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2023 02:21 PM
And also check these two Sys properties
- glide.sc.use_user_criteria property is set to true
- glide.sc.entitlement.override has the role only admin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 12:42 AM
@Sanket Pawar mind sharing the user criteria you have defined which is not working.
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 12:50 AM
Hi @sushantmalsure ,
Updated the user criteria as mentioned but still the caralog item is visible for finland user,please refer the below screenshot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 12:57 AM
I think you havent copied correctly:
Copy this complete.
var country = 'FI'; //validate this value for Finland var usr = new GlideRecord('sys_user'); usr.get(gs.getUserID()); if (usr.country == country) { retVal = true; } else { retVal = false; }
Now also it depends on where you have added this.
is it added in 'Available for' or 'NoT available for' related list under the catalog item.
Above code is for 'Not Available for'
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 01:03 AM
I have updated under "Not availble for" also updated the script ,still user is able to see the catalog item.