Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to hide single variable of one MRVS based on condition of another SinglRow Variable in cat. item

Nitesh Kumar5
Tera Contributor

Hi All,

I Need help on Multi Row Variable Set client side scripting on a catalog item. I have 2 variable set one is single row and another is Multi Row variable set.And the requirement is like based on first single row variable set (variable)selection I need to hide one or two variable of Multi Row Variable set which is containg more than 10 variables .

Example: We have two variable set: first and second

First is Single row which contains one variable named Service which is of select box type having three value : create, modify and delete.

Second variable which is Multirow variable set which contains 10 value : A ,B, C, D, E.....

and the requirement is like Based on first variable selection suppose if we select create option from first variable set(sinle row) then We need to hide A or B value from the second variable set(Multi Row).

Any suggestions how to achieve or reference is highly appreciated.

Thank You

1 REPLY 1

Brad Bowman
Kilo Patron
Kilo Patron

You can do this with an onLoad Catalog Client Script that applies to the MRVS.  Note that this will only hide the variable(s) in the add dialog - when the full MRVS is displayed on the request form, RITM, ... it will show all columns regardless of any actions taken to hide certain variables.

 

function onLoad() {
	if (g_service_catalog.parent.getValue('service') == 'create') { //parent variable name and value
		g_form.setDisplay('mrvs_a', false); //mrvs variable name
	}
}