How to hide variables in multirow variable set based on selection of other fields selection
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2023 04:50 AM
I have a requirement to hide multirow variable set's variable based on the selection of other field(out of MRVS).
How can i achieve this

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2023 05:05 AM
Hi Pallavi,
You need to write an onChange Catalog Client Script within the 1st MRVS, when your particular variable in the variable set changes. So for any row in MRVS1, when a certain value is selected, MRVS2 will become hidden. The script would look like this to hide the 2nd MRVS.
function onChange(control, oldValue, newValue, isLoading) { if (isLoading || newValue == '') { return; } if(newValue == 'My Choice'){//replace with the value that should hide MRVS2 if(this){//Service Portal method this.cat_g_form.setDisplay('mrvs2', false);//replace with the internal name of 2nd MRVS } else{//native UI method parent.g_form.setDisplay('mrvs2', false);//replace with the internal name of 2nd MRVS } } }
If you are using Service Portal, you will also need an onLoad Catalog Client Script within the Record Producer, not the MRVS.
function onLoad() { if (this) {//we only need to do this for Service Portal //We need to make the g_form object for the parent item available from the MRVS window this.cat_g_form = g_form; } }
ServiceNow Commnunity MVP -2018 class.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2023 05:17 AM
But i want to show variables of multirow variable set based on other variable selection(out of MRVS)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2024 06:09 AM