How to Make Catalog Item Variable Field Visible Only to Selected Users?

jlouie
Kilo Explorer

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.


9 REPLIES 9

Slava Savitsky
Giga Sage

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


grosch
Mega Expert

You'd need to do a g_form.setDisplay('nameOfYourVariable', false);


Bhavesh Jain1
Giga Guru

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.


jlouie
Kilo Explorer

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.