How to Hide variable from variable set for particular item

nagaklv
Tera Contributor

Hello Community,

Can anyone help us.

We have variable set with few variables and we are this variable set for couple of catalog items,

Our case we want hide particular variable in one catalog item how to do this tried with catalog client script onload and ui policy and it's not working still visible in portal Can anyone help us with solution for this

Please note this variable is mandatory in variable set

Thanks,

Nagesh

1 ACCEPTED SOLUTION

Tim Kulhavy
ServiceNow Employee
ServiceNow Employee

Hey! Using a catalog ui policy should be the easiest solution. Set the catalog ui policy to apply on the specific catalog item, build your condition (leave empty if it should always apply) and then use an UI policy action where you set the variable from the variable set to Mandatory -> false and Visible -> false. The other attributes can stay with "Leave alone".

This should work in Service Portal as well.

 

The UI policy action could look like this: (Standard Employee Questions is the variable set in this example)

find_real_file.png

View solution in original post

27 REPLIES 27

it was in only one catalog item. if it would be used in more than one, then should it be according to your solution? Correct me if i am wrong thanks.

It shouldn't matter how many Catalog Items are using the variable set. But you have to make sure that the variable set is related to the Catalog Item. Check the "Included in" Related list on the Variable Set record: 

TimKulhavy_0-1684261141519.png

Also as I said, make sure there are variables in the set.
Then, once you have added the Catalog Item to the above, you should be able to create a Catalog UI Policy for that Item and in the actions see the variables from the variable set as well as variables only present on the Item

TimKulhavy_1-1684261230441.png

 

It is not working for me.

Hi Keerthi, please post your question with a little detail in a new thread as this one is already answered. Thanks!

Bhavya Hegde
Kilo Contributor

and visa versa how to  make visible variable from variable set for particular item?