How to hide variable set on portal

Pratiksha KC
Tera Guru

Requirement is we have four variable sets and two variable sets should hide on portal but should visible on catalog task.

 

How can we achieve this? 

18 REPLIES 18

Shraddha Kadam
Mega Sage

Hello @Pratiksha KC ,

 

Create a catalog UI Policy on the catalog item and check that the 'Applies to Catalog Task' value is set to true. After that, add the variable set in the UI Policy action and save it.

ShraddhaKadam_0-1752134288467.png

 



 

If my response was helpful, please mark it as correct and helpful.
Thank you.

Ankur Bawiskar
Tera Patron
Tera Patron

@Pratiksha KC 

it's an easy requirement.

You can achieve it using either onLoad catalog client script or catalog UI policy

Ensure Applies on Catalog Item - Checked

Then hide it using script or catalog UI policy action

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Pratiksha KC
Tera Guru

Hi @Ankur Bawiskar  and @Shraddha Kadam 

 

I tried using UI policy but it's not hiding the VS on portal can you please look into screenshots

Below are the four VS and marked two we have to hide

PratikshaKC_0-1752135013179.png

UI Police-

PratikshaKC_1-1752135107606.png

 

PratikshaKC_2-1752135151053.png

 

Is this because we have mandatory fields and dependency of fields under variable set.

 

Uncheck applies on the Requested Item / Applies on Catalog Task field value and check Applies to Catalog Task' value is set to true.

If my response was helpful, please mark it as correct and helpful.
Thank you.