- 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
‎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
‎09-23-2019 06:12 AM
Hi Mark,
That worked. I didn't even think to remove the mandatory option from the fields.
Frank
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2019 02:24 PM
Thanks Mark,
It works now, I can't recall why I was having trouble getting it to work.
Frank

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2019 10:25 PM
Just did a quick test to verify. Just a new Catalog Item with a Variable Set which contains two fields. See below.
Set up a Catalog UI Policy, with Catalog UI Policy Action on my Variable Set (community_test_2019_09_21_1)
Result on Service Portal without any mandatory fields
Result on Service Portal when one field is 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