Glide Record check user satisfies the user criteria

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2020 11:48 PM
Hi Everyone,
Is it possible to add user criteria as a query in a GlideRecord?
Lets say, i want to display a knowledge base articles on the portal.
And some articles have user criteria.
I want my gliderecord to return only items that the user has access to.
Thanks,
Tadz
- Labels:
-
Request Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2020 11:57 PM
Hi,
when user visits the articles page he/she sees only those for which the user criteria is satisfied.
Why to check which user criteria s are satisfying
please check below link:
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
05-14-2020 12:24 AM
Hi Ankur, user criteria is working fine if they click the article.
But in my current query it would get all knowledge articles even though user did not satisfy the user critieria of the record.
I'm finding a way to display only articles that the user has access to.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2020 11:58 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2020 11:59 PM
If I understand you need to pass script in usercriteria that uses GlideRecord for logged in user.
If so, something as below should help.
answer=catItemRestriction();
function catItemRestriction(){
var gettitle=gs.getUser().getRecord().getValue('title');//gets title for logged in user from usertable
if(gettitle== 'Your title')
{
return true;
}
else
{
return false;
}
}