Catalog UI Policy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello,
I am setting up new Catalog Item that allows users to request software to be checked by Infosec staff so that they can check on privacy settings and so on. I have some varibales/questions that are visible to the user and some that need to be on visible to the Infosec member of staff. How do I acheive this via a Catalog UI Policy?
David
- Labels:
-
Request Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @davidsmith ,
Since you need to pick the users and based on users/Roels you want to show/hide varaibles so this can be achieved throguh Catalog Client script. Utilize methods from Glide user class and write your client script.
If my answer helped you, please makr it- solution accepted.
Regards,
Nikhil Bajaj
Regards,
Nikhil Bajaj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
since you want some variables to be shown/hidden based on group membership.
Please use onLoad catalog client script + GlideAjax
what did you start with and where are you stuck?
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
3 weeks ago
Thank you for marking my response as helpful.
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
3 weeks ago - last edited 3 weeks ago
Hi @davidsmith ,
>> Create a Catalog UI Policy....
Set the Condition to check for the user's role:
g_user.hasRole('infosec_role')
Define the actions you want to apply, such as setting the variable to mandatory or read-only...
** You can also use a Catalog Client Script for Dynamic Visibility **
Use the following script to check the user's roles and adjust variable visibility accordingly:
function onLoad() {
// Check if the user has the 'infosec_role'
if (g_user.hasRole('infosec_role')) {
// Show the variable for Infosec staff
g_form.setDisplay('variable_name', true);
} else {
// Hide the variable for end users
g_form.setDisplay('variable_name', false);
}
}
If you found my response helpful, please mark it as āAccept as Solutionā and āHelpfulā. This helps other community members find the right answer more easily and supports the community...
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Could you please help sharing the screenshots on how the role check condition can be applied in UI policy conditions field? It would be helpful for other members as well.
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader