- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2019 02:32 PM
I've gone through the community and tried several methods and nothing seems to work.
- g_form.setDisplay('variable_set_name', false)
- g_form.setVisible('variable_set_name', false)
I've even tired using a UI Policy with no luck. I tried to just hide the variables in the variable set and I could get it to hide them.
Can it be done? I'd also like it to work on the Service Portal.
Thanks,
Frank
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2019 10:21 PM
Hi there,
You should be able to hide Variable Sets and Multi Row Variable Sets. Thru scripting like you are mentioning, though also thru no code solutions like Catalog UI Policy. Thing to be aware of: if there is already one field mandatory in your variable set, hiding will not work (you should then make that mandatory field conditionally mandatory)!
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2023 01:10 PM
In my case I also needed to check that there aren't any containers in your variable set. If there are, you'll need to handle the containers in the variable set with their own line of code to set their visibility.
ServiceNow sees the variable set as something like a container, so having containers in the variable set confuses the UI Policy a bit.