User Criteria not working!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2022 06:32 AM
Hi Team,
I have build a user criteria to restrict my catalog items for germany users.
So, below is the screenshot of my user criteria
]
When i check for logs, sometimes working and sometimes not and all users are able to view the catalog item.
even though i mapped this user criteria in not availability column.
There is nothing in available column.
Can someone please help me how to fix this?
Thanks,
Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2022 07:05 AM
try this
It is recommended to use user_id to get logged in user sysId in user criteria script
are you comparing the correct country value?
are you having that logged in user with location populated?
answer = checkCondition();
function checkCondition() {
var user = new GlideRecord('sys_user');
user.get(user_id);
if (user.location.country == "DE") {
return true;
}
return false;
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2022 07:12 AM
Hi Ankur,
Still no luck!
Please help!
Thanks,
Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2022 09:02 AM
Did you try adding gs.info() in the user criteria script for debugging?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader