How to hide variable set on record producer?

Frank
Mega Expert

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

1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

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

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

5 REPLIES 5

Mark Roethof
Tera Patron
Tera Patron

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

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Hi Mark,

 

That worked. I didn't even think to remove the mandatory option from the fields.

 

Frank

Thanks Mark,

It works now, I can't recall why I was having trouble getting it to work.

Frank

Mark Roethof
Tera Patron
Tera Patron

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)

find_real_file.png

Result on Service Portal without any mandatory fields

find_real_file.png

Result on Service Portal when one field is mandatory

find_real_file.png

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn