How to transfer a multi-row variable set from a record producer to a case form

matthew135w
Tera Contributor

HI all,

 

How can I create a multi-row variable set in a case form with 3 columns and a dynamic number of rows?

 

Any suggestions on how to implement this in the case UI would be greatly appreciated.

 

Thanks.

1 REPLY 1

Community Alums
Not applicable

Hi @matthew135w ,

 

I think there is no direct way of creating MRVS on case form. Instead you can follow below steps so that your MRVS data on record producer can be see on case form.

 

- Create a new "HTML" type field on case form.

Sai149_0-1716951469331.png

- In your record producer script add below code

 

var mrvs = JSON.parse(producer.YourMRVSVariableSetName);

var mrvsData = [];
var tableHTML = '<table border="1" style="width:100%; border-collapse: collapse;">';
tableHTML += '<tr><th>Column 1 Label</th><th>Column 2 Label</th><th>Column 3 Label</th></tr>'; 

mrvs.forEach(function(row) {
    tableHTML += '<tr>';
    tableHTML += '<td>' + row.YourMRVSFieldName+ '</td>';
    tableHTML += '<td>' + row.YourMRVSFieldName+ '</td>';
    tableHTML += '<td>' + row.YourMRVSFieldName+ '</td>';
    tableHTML += '</tr>';
});

tableHTML += '</table>';
current.u_mrvs = tableHTML;

 

Sai149_1-1716951530751.png

 

 

Result:

I have submitted below

Sai149_2-1716951687107.png

final result

Sai149_3-1716951738532.png

 

In this way you can show MRVS data on any form.

 

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