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-12-2025 02:05 AM
check my below script
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 01:58 AM
Hello @Dr Atul G- LNG and @Ankur Bawiskar ,
By reading your reply for onSubmit() catalog client script any user can see the form but only manager can submit. However, I want the form strictly visible and submit by the user who is the present in the Manager variable (as mentioned in the above screenshot).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2025 02:04 AM
so please use onSubmit script which I already shared so that only the manager which is the logged in user can submit
function onSubmit() {
if (g_form.getValue('managerVariable') != g_user.userID) {
alert('You are not present in the manager variable so you cannot submit');
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-12-2025 02:20 AM
Hi @Ankur Bawiskar ,
I absolutely agree on your point but can't we do like this "I only want form to be visible to the for ex. Steve Roger's manager (who is Sourov) as given in the above screenshot."
If we use the onSubmit script it will be like change in the requirement.
Thanks,
Ankit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2025 02:26 AM - edited 03-12-2025 02:26 AM
is that manager variable auto populated with logged in user's manager or manually filled in?
To achieve your requirement you need to use User Criteria with script
Consider: Sourov logins and since he is manager of Steve he can see the catalog form and can submit it
If you login and you are not manager of any user then form is hidden
This solves your requirement for every user, why are you taking only Sourov as example?
Do you want form only to be seen by Sourov always?
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