MRVS variable visibility dependent on catalog item variable

Vee Jay Recana
Mega Guru

I have catalog item named offboarding request form. Inside that catalog item are variables and an MRVS. Is it possible to make the visibility of a variable in MRVS dependent on the variable from the main catalog item? If yes, how can I achieve it?

For example, variable "A" from the main catalog item is a select box containing several options. I have a multi row variable set named asset details. Inside the MRVS, I have a variable named serial number. If I select 1st option in field A, the serial number should be hidden and non-mandatory.

 

Thank you.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Vee Jay Recana 

yes you can access outside variable within onload or onchange catalog client script which applies to MRVS

Once you access you can show/hide and do whatever you want

check my blog and enhance your logic

Access value of catalog item variable within MRVS client script 

Something like this

You can access the variables with this syntax. This works in both Native + Portal

var applicationType = g_service_catalog.parent.getValue("variableNameA"); // give the variable which is outside variable

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@Vee Jay Recana 

yes you can access outside variable within onload or onchange catalog client script which applies to MRVS

Once you access you can show/hide and do whatever you want

check my blog and enhance your logic

Access value of catalog item variable within MRVS client script 

Something like this

You can access the variables with this syntax. This works in both Native + Portal

var applicationType = g_service_catalog.parent.getValue("variableNameA"); // give the variable which is outside variable

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader