User criteria (Not Available For) not working - catalog item still visible on portal

JordyZ
Mega Sage

Hi,

 

I have a catalog item that I only want visible for one specific region: APAC (region is a custom field on the user table). I have a configured a user criteria (not available for) on the catalog item.

JordyZ_0-1687362987676.pngJordyZ_1-1687363032458.png

All regions selected except APAC.

 

However, the catalog item is still visible on the portal, even when the user's region isn't APAC.

JordyZ_2-1687363190773.png

 

JordyZ_3-1687363241229.png

Any tips on how to hide this catalog item from all regions except APAC? Any help is appreciated.

EDIT: I've flushed the cache, but no success.

1 ACCEPTED SOLUTION

Steven Parker
Giga Sage

Wouldn't it be easier to make the catalog item "Available For" 1 region versus "Not Available For" 6 different regions?

 

Making it Available For the APAC region would hide it from all others automatically.


Please mark this response as correct and/or helpful if it assisted you with your question.
Steven

View solution in original post

6 REPLIES 6

Admins have an override that allows them to see all catalog items.  You can read more about that here and how to get around it if needed.

 

https://www.servicenow.com/community/developer-forum/user-criteria-to-exclude-admins/m-p/1608714 

 

Admins will always see the Catalog Items (Record Producer and Order Guides) despite the User Criteria denying the access.

Reason: System Property "glide.sc.entitlement.override" allows Admins to see all the Catalog Items

 


Please mark this response as correct and/or helpful if it assisted you with your question.
Steven

Steven Parker
Giga Sage

Also, with Region being a custom field you may need to use a script for the User Criteria.  I would create an APAC Region User Criteria and use it in the Available For.  Just check Advanced on the User Criteria and use a script similar to below:

 

checkCondition();

function checkCondition() {
var user = new GlideRecord('sys_user');
user.get(user_id);

if(user.u_region == 'apac') {
return true;
}
return false;
}

 

Once you add this User Criteria to the "Available For" section, it would hide the item from everyone not in the APAC region.

 


Please mark this response as correct and/or helpful if it assisted you with your question.
Steven