Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

catalog item visible to user only for the first time

Likith
Tera Contributor

How can we make the catalog item visible to user only for the first time?

1 ACCEPTED SOLUTION

RaghavSh
Mega Patron

1. Create a user criteria "Available for" for your catalog item with below script:

answer=false;
var user   = new GlideRecord('sys_user');
user.addEncodedQuery('last_login_timeISEMPTY^sys_id='+gs.getUserID())
user.query();
if(user.next())
{
answer=true;
}


Please mark the answer correct/helpful accordingly.


Raghav
MVP 2023
LinkedIn

View solution in original post

1 REPLY 1

RaghavSh
Mega Patron

1. Create a user criteria "Available for" for your catalog item with below script:

answer=false;
var user   = new GlideRecord('sys_user');
user.addEncodedQuery('last_login_timeISEMPTY^sys_id='+gs.getUserID())
user.query();
if(user.next())
{
answer=true;
}


Please mark the answer correct/helpful accordingly.


Raghav
MVP 2023
LinkedIn