Only Requested by's Manager can access the Catalog Item form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2025 06:45 AM
I have created the attached Catalog item form, I want to make this visible only for the user who is in the Manager variable (who is the Manager of the user which is present in the Name variable), could anyone tell me how we can do that?
catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2025 06:48 AM
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2025 06:48 AM
you can use onSubmit catalog client script and see who is the logged in user?
If logged in user is different than Manager then stop the form submission
function onSubmit() {
if (g_form.getValue('managerVariable') != g_user.userID) {
alert('Only managers can submit this request');
return false;
}
}
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2025 06:51 AM
you can also user criteria with script and add this in Available For related list in your catalog item
Only logged in users who is manager of at least 1 user will see the catalog item
Apply user criteria to items and categories
var gr = new GlideRecord("sys_user");
gr.addQuery("manager", user_id);
gr.setLimit(1);
gr.query();
answer = gr.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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2025 02:04 AM
Hi @Ankur Bawiskar,
So, if we use the above script then that form will be visible to any manager, but I only want form to be visible to the for ex. Steve Roger's manager who is Sourov as given in the above screenshot.
Thanks,
Ankit