How to pass multi row variable set values to a list collector field?

HARI KISHAN GVS
Mega Sage

Hi Team,

I am trying to pass multirow variable set values to list field on the target record but those are not setting the correct values.

i am using the record producer script like below. 

in my target record, u_factory_systems is a list type field with choices, choices sys_id's are mentined in the push line in the script.

can anyone please correct my script?

HARIKISHANGVS_0-1699373605027.pngHARIKISHANGVS_1-1699373631931.pngHARIKISHANGVS_2-1699373707727.png

Thanks in advance,

Hari Kishan.

1 ACCEPTED SOLUTION

Brad Bowman
Kilo Patron
Kilo Patron

You need to get the value of the MRVS, which will be a JSON of all the rows, then loop through it to push the sys_ids to the array if each variable of each row is true.

 

So start with something like this:

var arr=[];
var mrvs = producer.factory_systems;
var rowCount = mrvs.getRowCount();
for (var i=0; i<rowCount; i++) {
    var row = mrvs.getRow(i);
    if (row.ipw == "true") {
        arr.push('aad7c94f1b83a4500c86cbb4604bcbfe');
    }
    if (row.infact == "true") {
        arr.push (...
   }
   ...

 

View solution in original post

1 REPLY 1

Brad Bowman
Kilo Patron
Kilo Patron

You need to get the value of the MRVS, which will be a JSON of all the rows, then loop through it to push the sys_ids to the array if each variable of each row is true.

 

So start with something like this:

var arr=[];
var mrvs = producer.factory_systems;
var rowCount = mrvs.getRowCount();
for (var i=0; i<rowCount; i++) {
    var row = mrvs.getRow(i);
    if (row.ipw == "true") {
        arr.push('aad7c94f1b83a4500c86cbb4604bcbfe');
    }
    if (row.infact == "true") {
        arr.push (...
   }
   ...