User Creteria not working for a Record Producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 02:23 AM
Hi Team ,
We have a Record Producer created , we have a custom column/field called as "Function" whose value is "People" in the User table , we want to hide the Record Producer from these People function user.
I have tried the below script in the Not available for ,
Which is failing , still the users are able to see it , kindly assist!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 02:50 AM
Hello @SandeshD
You have just used user_id
Either use gs.getUserID() or gs.getUser() and dot walk to user id.
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 03:03 AM
Hi,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 05:31 AM
Not Working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 03:13 AM
so please add this script in User Criteria and add in Available For related list
I hope you are using the correct field name and the correct value to compare for u_sf_function
var grp = new GlideRecord('sys_user');
grp.addQuery('sys_id', user_id);
grp.addEncodedQuery('u_sf_function=******'); //sf function=people
grp.query();
answer = !grp.hasNext();
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader