How to display multi-row variable set in approval ticket in UI16?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2021 05:04 PM
Hello Community,
When submitting a service catalog item form that contains a multi-row variable set, such variable set does not appear in associated approval tickets when accessed through UI16 (image below). Has any one found a solution to this issue?
Thanks,
Ben Benjamin.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2021 05:52 PM
Based on what you can find here:
- A multi-row variable set is supported in the variable summarizer only in Service Portal.
- You cannot set Global as True for any variable that belongs to a multi-row variable set. So, a multi-row variable set is not available in catalog tasks.
I don't believe you'll find a precise solution for this, as for all intents and purposes, this is behavior as designed.
I did however find this article: https://community.servicenow.com/community?id=community_article&sys_id=c70c9e3adbeb6f001089e15b8a961...
This provides some insight into how to format an email or a description field with the values, which you might be able to adapt to your purposes.
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-22-2021 11:22 AM
I also found the variables are completely missing from an approval ticket when viewed from the agent workspace (image below). Does anyone know how to add the approval summarizer or variable editor or anything similar to show the variables from the related RITM?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2023 01:45 PM
Hello,
Here's how I did it:
Code placement:
New UI Macro that calls a new script Include. The new UI Macro is called by the existing Variable Summarizer via a g:call
The Script include returns variable data, the new UI Macro parses out any MRVSs Into a HTML table.
Script Include:
Name: GetMultiRow
Description: Called by UI macros in the Approval Var summarized. This is to get Multi Row Var sets
Application: Global
Accessible from: All application scopes
Client Callable: Yes
var GetMultiRow = Class.create();
GetMultiRow.prototype = {
getMRVs: function(sysID) {
var jay = [];
var ret = [];
var gr = new GlideRecord("sc_req_item");
gr.addQuery("sys_id", sysID);
gr.query();
while (gr.next()) {
jay = new GlobalServiceCatalogUtil().getVariablesForTask(gr, true);
for (var i = 0; i < jay.length; i++) {
if (jay[i].multi_row) {
ret.push(jay[i]);
}
}
}
return ret;
},
};
UI Macro:
Name: approval_multi_row_variable_summary
Description: Returns the MRVSs for a giving reqest / task
Application: Global
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate jelly="true">
var sys_id;
if (!JSUtil.nil(jelly.jvar_sc_req_item))
sys_id = jelly.jvar_sc_req_item;
if (!JSUtil.nil(jelly.jvar_sc_task))
sys_id = jelly.jvar_sc_task;
var getMRV = new global.GetMultiRow();
var mrvs = getMRV.getMRVs(sys_id);
var ret = [];
var row;
ret.push('<table cellspacing="0" cellpadding="0" >');
for (var i = 0; i < mrvs.length; i++) {
row = '';
if (mrvs[i].multi_row) {
row ='<tr><td colspan="2"><b>' + mrvs[i].label + '</b></td></tr>';
for (var j = 0; j < mrvs[i].table_variable.length; j++) {
for (var k = 0; k < mrvs[i].table_variable[j].length; k++) {
row +='<tr><td>'+mrvs[i].table_variable[j][k].label + '</td><td>' +
mrvs[i].table_variable[j][k].display_value +'</td></tr>';
}
}
}
ret.push(row);
}
ret.push('</table>');
</g:evaluate>
<ul>
<j:forEach var="jvar_label" items="${ret}">
<g:no_escape>
${jvar_label}
</g:no_escape>
</j:forEach>
</ul>
</j:jelly>
Existing UI Macro:
Name: approval_variable_summary
Add this code after ~ line 17
<g:call function="approval_multi_row_variable_summary.xml" question_name="${task.sys_id}" question_help_tag="${smart_description}"
sc_req_item="${task.sys_id}" help_class="${jvar_line_color}" />
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2024 05:16 PM
@staticCrash This code was extremely helpful in resolving a last minute issue identified while testing before a release. I really appreciate you contributing this to the SN Community.