How to Make Catalog Item Variable Field Visible Only to Selected Users?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2014 11:17 AM
Hello,
Does anyone know how to restrict the visibility to only selected users (or a group) for a Service Catalog item variable field?
My catalog item contains 2 variables: 1 that asks a question and a second that I'd like to use to store the XML document results from a call to a SOAP external Web service function. I would like the second variable to be only visible on the form to certain users (our DBA group members) since this XML logging info should not be seen by the requester or anyone else outside the DBA group.
In my test, after the catalog item request has completed executing, the XML results (activity.output) do display in the second variable on the form. But I want to hide this second variable field on the form from anyone other than the DBA group members.
I am new to ServiceNow and scripting, so any helpful pointers would be much appreciated. Thank you.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2014 12:18 PM
The most straightforward approach would be to use an onChange catalog client script to hide the second variable when its value changes.
Creating a Catalog Client Script - ServiceNow Wiki
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2014 02:50 PM
You'd need to do a g_form.setDisplay('nameOfYourVariable', false);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2014 10:58 PM
You can also write a UI policy for this. One good thing about UI policy is that the Condition filter is evaluated on the server side. Make use of UI policy actions to hide/unhide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2014 05:29 AM
Hello,
Thank you for the replies and suggestions! I will look into these approaches and see if I can get it to work for me. I will post again when I have some progress to report.
Thanks.