
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
01-24-2021 10:08 PM - edited 08-03-2024 07:04 AM
Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
Hi there,
A lot has been written on Multi-Row Variable Sets, some great resources out there. Some popular questions remain unanswered though, or: just not possible. One of these questions: "Hiding variables within the Multi-Row Variable Set". With the Quebec-release, this is now possible!
Hiding a Variable [Pre-Quebec]
Usually one would hide Variables through either Catalog UI Policy in combination with Catalog UI Policy Actions or through Catalog Client Script. For Multi-Row Variable Sets, up to the Paris-release scripting like g_form.setVisible() or wouldn't work. Also applying the Visible field on Catalog UI Policy Actions was read-only on purpose.
So short answer up to the Paris release, hiding a variable within a Multi-Row Variable Set: not possible.
Quebec-release
The Quebec Service Catalog release notes mentions:
Enhancements for a multi-row variable set (MRVS)
• Hide a variable in the MRVS so the question does not appear to users.
Hiding a Variable [Post-Quebec]
So let's dig into this! My first thought was, is the read-only field now usable on Catalog UI Policy Actions on Multi-Row Variable Sets? Yes, it is!
My second thought was, could you also use scripting like g_form.setVisible() within Catalog Client Scripts on Multi-Row Variable Sets? Well, we need to test this. Previously you could also script this though it would simply not work.
The first test case is a simple Catalog UI Policy with a Catalog UI Policy Action.
The second test is a Catalog Client Script using g_form.setVisible().
Result
In both cases, the end result is exactly the same. Both work as expected! Oke, it's a simple test. Though you could think of situations where you have a more complicated Catalog Item and Multi-Row Variable Set, having dependencies on which variables to display, etcetera. Though basic mechanism which we need for this works like a charm.
---
And that's it actually. Hope you like it. If any questions or remarks, let me know!
C |
If this content helped you, I would appreciate it if you hit bookmark or mark it as helpful.
Interested in more Articles, Blogs, Videos, Podcasts, Share projects I shared/participated in? |
Kind regards,
Mark Roethof
ServiceNow Technical Platform Architect @ Quint Technology
1x ServiceNow Developer MVP
1x ServiceNow Community MVP
---
- 16,130 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I am currently trying to hide a field on a multi row variable set. I am currently on Paris.
I am trying to hide Sub issue below if ECA is selected:
I have tried client script and UI policy but cant seem to make it happen!
Any help appreciated thanks!
I tried the option above no luck.
Also tried the following on a script:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
var issueType = g_form.getValue('issue');
if(issueType == 'ECA - Employee Corrective Action'){
g_form.setDisplay("category",false);
}
}
Thanks!

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi there,
On Pre-Quebec hiding a Variable within MRVS: just not possible.
Kind regards,
Mark
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Perfect! Thank you!
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thanks Mark for this. Great to see this functionality.
I have a question. Whilst this is great from the 'Add Row' point of view, do you know if the is a way to hide the variables (e.g. Question 1 in green box) from the catalog page?
Cheers,
Paul
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Marc
Thanks for this article.
Is there a way to do bulk updates on a multi row variable like we do on the list view of a table?
When the number of rows are large, it becomes hard for the user to open each row and update it.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Is is possible to hide the entire variable set (i.e not just the variables in the set)? I don't want it to show up at all on the portal for the end user but need it to show up on the requested item.
Thanks

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi there,
Never tried, though theoretically I would think this should be possible. Just give it a try.
Kind regards,
Mark
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
NBeheydt
You can create a Catalog UI Policy and hide the variable on the portal.
Check the option "Applies to a Catalog Item view" on the catalog UI policy.
Create a Catalog UI policy action to hide the variable.
Please mark my answer as helpful/correct if it works.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Yes, I tried that but all it does is hide the individual variables in the variable set. It doesn't hide the actual variable set.

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
It works fine here (tested on Rome). Can you share in exact detail what you tried and is not working (for example screenshots)?
Kind regards,
Mark
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Here are screenshots of the UI Policy and how the variable set still shows up.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Paul. Did you ever get an answer to your question? I too am trying to hide a variable from the grid view but I need it to show in the edit/add view of the row.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
After some more digging I was able to figure this out from this post.
Conditional visible Multi-Row Variable Set - Developer Community - Article - ServiceNow Community
The key is to add the UI Policy to the catalog item, not the variable set. When adding the UI Policy action, select the variable set.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Mark,
Scenario: our MRVS is auto-populated with four values., Is there a way to hide the next rows based on values selected in the previous row?
Thanks,
Manisha

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Can you or someone else from the team please advise on the question above?
The UI policy does what it is supposed to do; however, the grid still shows.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@Mark Roethof , can we hide a variable in MRVS based on the variable outside the MVRS?
i tried hiding based on a check box using client script, but not worked.
Any help greatly appreciated.
Thanks,
Mani.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi @Edxavier Robert ,
Based on a check box on the form, I wrote the below onChange client script. I have 2 variable in the MRVS. When checkbox is marked, I need one variable to be visible and one to be hidden and vice versa. find the script below.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue == true){
g_form.setDisplay('mailbox_accessType_1',false);
g_form.setDisplay('mailbox_accessType_2',true);
}else{
g_form.setDisplay('mailbox_accessType_2',false);
g_form.setDisplay('mailbox_accessType_1',true);
}
}
Thanks,
Mani.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
That was great !!!
But how to hide a variable of multi-row variable set based on variable value which is not part of the multi-row variable set.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@Mark Roethof Hi, we are using one MRVS for three to four catalog item. but i want to hide some variables for one catalog only. how can we achieve this?