Hide label type variable which has check boxes

DPrasna
Tera Contributor

Hello All,

I have a "Label" type variable below which I have 3 checkboxes as shown below

DPrasna_0-1678813669804.png

And I am trying to control the visibilty via Catalog client script as shown below

 

function onChange(control, oldValue, newValue, isLoading) {
	if (isLoading || newValue == '') {
		g_form.setVisible('demo_variable_set', false);
		//g_form.setDisplay('Demo_variable_set.dev_roles', false);
		//
		return;
	}

	
			
			g_form.setVisible('demo_variable_set', true);

		}
		else{
			///

		}

		//g_form.setValue('variable name',answer);

	}

}

 

However, I am not able to hide the label variable it appears as shown below

DPrasna_1-1678813866162.png

I read from community and a KB that it cannot be hidden.

But I need help with hiding the variable or any possible workaround. Please

 

Entire variable set name - g_form.setVisible('demo_variable_set', false);

 

 

TIA

@Allen Andreas @priyasunku @SatyakiBose @Mark Roethof @BharathChintala 

5 REPLIES 5

Allen Andreas
Administrator
Administrator

Hi,

I'd recommend using container variables with a container start before (field order number) the label and checkboxes, then a container end at the end. Then you can simply use a UI Policy to hide all of those together using the container, versus individual fields/variables.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi,

If you need to evaluate a GlideAjax response to determine whether to show a label variable and checkboxes, then as I mentioned above, please use a container variable around the label and checkboxes, and then you can simply hide the container instead, in client script.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi @DPrasna 

Thanks for marking my reply as Helpful.

If it also helped guide you correctly, please also consider marking it as "Accept Solution".

Thanks and take care! 🙂


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

BharathChintala
Mega Sage

@DPrasna based on what you want to hide???

 

do you want to hide label or check boxes ??

 

or do you want to hide variable set??

 

 

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala