How to Display Multi Row Variable set (MRVS) data in a notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2021 09:31 AM
Notifcation wrtitten on sys approver table and i am using an Email script used :
template.print("Summary :<br />");
var item = new GlideRecord("sc_req_item");
item.addQuery("sys_id", current.sysapproval);
item.query();
while(item.next()) {
template.print(item.number + ": " + item.quantity + " X " + item.cat_item.getDisplayValue() + "<br />");
template.print(" Options:<br />");
var keys = [];
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(item.sys_id);
set.load();
var vs = set.getFlatQuestions();
for (var i=0; i < vs.size(); i++) {
if(vs.get(i).getLabel() != '' && vs.get(i).getDisplayValue() != '') {
template.space(4);
template.print(' ' + vs.get(i).getLabel() + " = " + vs.get(i).getDisplayValue() + "<br />");
}
}
}
But in the notification the multi row variables are are not showing .
The multi row variable in form is shown below :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2021 09:37 AM
Hi,
You should write a mail script for the same.
var mv=current.variables.mvrs;
for(var i=0;i<mv.getRowCount();i++)
{
mv.getRow(i).your_variable_of_mvrs)//your_variable_of_mvrs
}
If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.
Regards,
Saurabh
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2021 09:41 AM
I need to write a general email script to get all the MRVs .
The notification is triggered is for all other RITMS as well.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2021 09:47 AM
Hi there,
See this article which I wrote a few months ago. It can help you creating a nice summary for your notification.
Creating records or a summary from Multi-Row Variable Set (2)
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field