Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

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

Raghav Sharma24
Giga 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.

View solution in original post

1 REPLY 1

Raghav Sharma24
Giga 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.