- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2021 02:17 PM
I have a Multi-row variable set which I am using in a catalog item , how to hide a variable on that , I am not able to hide the Variable Using UI policy as the visible is grayed out
I also created a onload cS still not working
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2021 01:36 PM
Eg: I have location reference variable on my MRVS then I added location table to match it .
Quick Demo
Hope it will help you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2021 02:23 PM
Unfortunately, it's not an option in an MRVS:
You can define catalog client scripts, catalog UI policies, and catalog data lookups for a multi-row variable set. But, you cannot edit the visibility settings of its variables using catalog client scripts and catalog UI policies, that is, the g_form.setVisible() is not honored in catalog client scripts, and the Visible field of a catalog UI policy action is read-only and set to Leave alone.
I hope this helps!
If this was helpful or correct, please be kind and remember to click appropriately!
Michael Jones - Proud member of the CloudPires team!
Michael D. Jones
Proud member of the GlideFast Consulting Team!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2021 02:35 PM
Thanks Michael
The issue we are facing is we are trying to report on the MRVS by creating a database view , but we have a reference field where in that report we are only getting the sys_ID , one of the community member suggested to use the string field and copy the reference field value to the string field ( which is working fine ) but the issue is we cannot have 2 same fields on the form , Is there any alternate solution for this?
ref this is what we followed
https://community.servicenow.com/community?id=community_question&sys_id=252bce56dbd363809a64e15b8a961921

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2021 03:59 PM
So...I'm not fan of DOM manipulation in general, but as long as we're not drastically altering elements in a way that might break them it's generally ok for one-off situations like this. That being said, there is a way you could do it, with a little extra work.
First you will need the sys_id of the variable you want to hide, along with the name of the variable.
You will also want to make sure that the variable is at the bottom of the list in the variable set as what I can show you will make it not visible, but it will still take up space in the layout.
Then, a script like this onload in the variable set should do the trick - just replace the name and sys_id and give it a go!
You will need to set isolate script for this one to false (unchecked) - if that is not on the form for your client script, you can add it to the list view and set it there.
function onLoad() {
//Type appropriate comment here, and begin script below
var sys_id = '1afe7f2b07b1a010c5cff1e08c1ed061'; //populate with your variable sys_id
var field_name = 'text'; //populate with your variable name
if (window === null) {
//we are in the Service Portal so we use jQuery
setTimeout(function() {
this.jQuery("#" + field_name).hide();
}, 500);
} else {
//We are in the UI so we use getElement
g_form.getElement('IO:' + sys_id).style.display = "none";
g_form.getElement('variable_IO:' + sys_id).style.display = "none";
}
}
I hope this helps!
If this was helpful or correct, please be kind and remember to click appropriately!
Michael Jones - Proud member of the CloudPires team!
Michael D. Jones
Proud member of the GlideFast Consulting Team!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2021 06:02 PM