how to hide variable set

Deepthi13
Tera Expert

hi team,

i am trying to hide variable set in mobile view, for that i have written onload client script for that variable set as below, the same logic is working for variables in item, where as it is not working for variable set items, please find below code and help me on the same. FYI, i am getting both the alerts below, but hiding is not

happening

find_real_file.png

 

function onLoad() {
//Type appropriate comment here, and begin script below
var loc = top.location.toString();
loc = decodeURI(loc) ;
alert('hello'+loc);
if (loc.indexOf('mob_order_guide') >= 0) {
alert('hello2');
//g_form.setDisplay('Policies',false);
//g_form.setDisplay('Links_to_MAC_FAQ_and_it_policy',false);
g_form.setVisible('Policies',false);
g_form.setVisible('Links_to_MAC_FAQ_and_it_policy',false);
}


}

1 ACCEPTED SOLUTION

Bhojraj Dhakate
Tera Expert

Hi,

Change: Applies to --> Catalog Item and select the catalog item name instaed of Variable set name

Use this g_form.setDisplay('VARIABLE_SET_NAME',false); on UI Policy or Client Script.

Replace 'VARIABLE_SET_NAME' with the name of your variable set.

find_real_file.png

Thanks,

Bhojraj

 

View solution in original post

8 REPLIES 8

Alikutty A
Tera Sage

Hi,

Can you try to hide a single variable within your variable set and see if it hides on mobile view? Also use setDisplay()

Thanks!

first, i have tried with variable names only, but it is not hiding! 

find_real_file.png

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,


See this:

https://hi.service-now.com/kb_view.do?sysparm_article=KB0610336

 

Thanks,
Ashutosh

Bhojraj Dhakate
Tera Expert

Hi,

Change: Applies to --> Catalog Item and select the catalog item name instaed of Variable set name

Use this g_form.setDisplay('VARIABLE_SET_NAME',false); on UI Policy or Client Script.

Replace 'VARIABLE_SET_NAME' with the name of your variable set.

find_real_file.png

Thanks,

Bhojraj