Cannot print Multi Row Var set on Email notifications


Description

Steps to Reproduce

The problem is that the OOTB function method only prints flat variables:

var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(sc_req_item.sys_id);
set.load();
var vs = set.getFlatQuestions();


Workaround

  1. Try to access variables and sending notification using a workflow.
  2. Or you can try below code in the email script by getting the MRVS used in a particular request (Even if few are getting visible/display on the basis of some UI policy)
var ritmGR = new GlideRecord('sc_req_item');if (ritmGR.get(current.sys_id)) //Here you need to get the current request's sys_id
{
mrvs = ritmGR.variables.book_details; //multi row variable set info. Here insted of giving specific name you can use name of MRVS returned after querying variable set of a catalog item
rowCount = mrvs.getRowCount();
for (var a = 0; a < rowCount; a++) {
var row = mvrs.getRow(a);
template.print( "<tr>" );
template.print( "<td><center>" +row.type + "</center></td>" );
template.print( "<td><left>" +row.title + "</left></td>" );
}

Related Problem: PRB1406382