Multi Row Variable Sets not Showing in catalog item

ragz
Tera Expert

I have a service catalog item and it contains some variables and variable sets .

All variables and single row variable sets are showing up on the service catalog item .

But Mutli row variable set is not showing up , I dont know what I am doing wrong .

Need you support ...

1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

Hi there,

If you disable all Container variables within that Multi-Row Variable Set, is the Multi-Row Variable Set shown then? We had some similar issues too due to incorrect usage of containers with Multi-Row Variable Sets.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

12 REPLIES 12

Not using any UI policy or Client catalog script .

The form contains 40 + variables including container variables .

Hi there,

If you disable all Container variables within that Multi-Row Variable Set, is the Multi-Row Variable Set shown then? We had some similar issues too due to incorrect usage of containers with Multi-Row Variable Sets.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

James Gragston
Tera Guru

ragz,

Do a query on the [io_set_item] table to find your catalog Item(s) with the particular variable set (in your case a MR var set) and put the display value of that sys_id into a variable:

**current record originates from the [sysapproval_approver] table**

//Depending on where you're running this script, you may have to replace 'current'
var targetRec = current.sysapproval;
var set = [];
var getSets = new GlideRecord("io_set_item");

getSets.addEncodedQuery(
    "variable_set.type=one_to_many^sc_cat_item=" + targetRec.cat_item.toString()
);
getSets.setLimit(1); //you only need one record to return with the MRVS value
getSets.query();

if (getSets.next()) {
    set.push(getSets.variable_set.internal_name.toString());

}
//now 'set' holds the internal name of your MRVS
var intName = set[0];
//with the internal name, you can use the variables object to get mrvs values
var mrvsString = targetRec.variables[intName];

 

the last line from the script above will return a JSON object, something like this:

find_real_file.png

Yeah, the names of the variables are nonsense but this is how the object is constructed.

Get each value with this syntax: gs.info(mrvsString[0]['SAR_first_name']);

To make this object a String value use : var something = JSON.parse(mrvsString);

 

Hope this helped!

 

asifnoor
Kilo Patron

Hi ragz,

Try this code in background script and check to see if there is any data in your multi row variable set or not.

var mrvs;
var itemID = '70506da8db002300e69dfbef2996194a'; //replace with your RITM sys_id
var ritmGR = new GlideRecord('sc_req_item');
if (ritmGR.get(itemID)) {
    mrvs = ritmGR.variables.your_multi_var_set;
}
gs.print(mrvs);

Mark the item as a correct answer and helpful if it helps.

Mark Roethof
Tera Patron
Tera Patron

Hi there,

If you disable all Container variables within that Multi-Row Variable Set, is the Multi-Row Variable Set shown then? We had some similar issues too due to incorrect usage of containers with Multi-Row Variable Sets.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn