Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

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,

Please refer to the screenshots.

case 1 screenshot: which refers the UI policy is working

case 2 screenshot: which refers the UI Policy is not working on variable editor.

- Thank you.

Hi Sai,

Can you share the script of UI policy here?

Regards
Ankur

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

Hi Sai,

I was able to reproduce the issue in scoped app for Record Producer

It doesn't hide the variable set using g_form.setDisplay()

It works using g_form.setVisible()

Please raise a HI ticket with ServiceNow and keep us updated.

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Hi Ankur,

setVisible is making the form ugly. We will raise HI ticket and will keep you posted.

- Thank you.

Hi Sai,

Do let us know the update.

I believe this question is answered now.

If my answer solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact.

Regards
Ankur

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