We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Regarding catalog item

shreya_3009
ServiceNow Employee

I created a catalog item and in user criteria, i have mentioned the department to which then catalog item should be visible. It is visible to the department members and also admins. Cant we restrict admins here?

5 REPLIES 5

Ankur Bawiskar
Tera Patron

@shreya_3009 

why would admins raise request?

Currently your user criteria will be satisfied when admins belong to that department

The only way is use advanced script

if (gs.hasRole('admin'))
    answer = false;
else {
    var gr = new GlideRecord("sys_user");
    gr.addQuery("sys_id", user_id);
    gr.addQuery("department.name", "ABC");
    gr.query();
    answer = gr.hasNext();
}

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader