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

Hi @Ankur Bawiskar ,

can you please help me on below thread?

https://community.servicenow.com/community?id=community_question&sys_id=8ef7589ddb951490feb1a851ca96... 

- Thank you.

Hi Sai,

Can you mark the reply from my side which helped you so that it would benefit others.

Such as the one which I said that I was able to replicate the issue.

Regards

Ankur

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

@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

rajneeshbaranwa
Giga Guru

Please make sure that Apply on Requested Item or Catalog Task is selected.

You can also do it using one of UI Policy action rather than using g_form.setDisplay('variable_set', false);

but I do not see anything wrong in using g_form.setDisplay('variable_set', false); 

Hi Rajneesh,

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.