How to hide the Variable Set on Variable Editor using UI Policy in Scoped Application?

User177031
Kilo Guru

Hi All,

I am trying to hide the variable sets(~25) based on condition through UI policies on Catalog form & Variable Editor in scoped application.

g_form.setDisplay('variable_set', false); - is not working in scoped application.

What are the ways to achieve this requirement?

- Thank you.

1 ACCEPTED SOLUTION

@Sai Venkatesh Suryadevara 

Is this question resolved or you need some more assistance?

Are you giving variable set name in the script?

Regards
Ankur

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

View solution in original post

19 REPLIES 19

Satyanarayana C
ServiceNow Employee
ServiceNow Employee

Hi

Could you please provide a screenshot of what you want to hide?

Thanks

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

So you want to hide variable set which contains ~25 variables

But it is not working in scoped app?

What are the type of variables inside it?

UI Policy applies on catalog or RITM view?

try setVisible()

g_form.setVisible('variable_set', false);

Regards
Ankur

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

Hi Ankur,

We had created a variable(abc) with type as select box (25 choice values in it) on a record producer in scoped app. Based on the selection of choice in that variable (abc), we want to hide the variable sets on Variable Editor of scoped app.

Example: If I select the choice as 'Submit a Case', then I want to show the variable set related to Case and rest of the Variable Sets should be hidden.

I am able to achieve the requirement on Catalog form but not on the Variable Editor. Enabled 'Applies on the Target Record' condition on Catalog UI Policy but still no luck.

When I try to replicate the same in demo instance under global application, it is working good.

g_form.setVisible is messing up the form as it leaves the empty place between the variables.

Note: Some variables like Short Description, Description, Configuration Item, Business Service, Additional Notes were created as Variables under record producer (not in variable sets) and they were used based on the selection of choice on 'abc' variable.

- Thank you.

Hi @Ankur Bawiskar ,

Do you have any update on above mentioned query?

- Thank you.