Mapping of multi row variable set in fulfilment record

PriyankaSadhwni
Tera Expert

Hello,

All variables of record producer are getting transferred /mapped in custom target  table (not in fields present in table, but they are visible in 'Task Read only Varriable editor' except one new multirow varriables  I mean to say; 'map to field' is false for all varriable.

 

PriyankaSadhwni_0-1684331884800.png

 

'

PriyankaSadhwni_1-1684332066739.pngPriyankaSadhwni_2-1684332137289.png

 

I am looking for:

I want to fetch and Print all 10 to 15 rows of multirow varrible set in  field -type multi Line.
I wonder why fields of mutirow varriables is not coming in Variables section even once

1 ACCEPTED SOLUTION

Harshal Aditya
Mega Sage
Mega Sage

Hi @PriyankaSadhwni ,

 

Hope you are doing well.

If map to field is set to false the variable mapping must be defined in the script field on the record producer.

 Please refer below script to print mrvs values

var mrvs = JSON.parse(producer.testmrvs); // replace with mrvs internal name
var value = "";
for (var i in mrvs){ // consider test1 and test2 are two variable in mrvs
	value  =value+ "test1" + " "+mrvs[i].test1 +" "+"test2" + " "+mrvs[i].test2+"\n";
}
gs.log(value);

 

 

Please mark this response as correct or helpful if it assisted you with your question.

Regards,
Harshal

View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

@PriyankaSadhwni 

any client script or ui policy is clearing out those?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

PriyankaSadhwni
Tera Expert

@Ankur Bawiskar    NO Such CS or UI Policy as Except MRVS all other  variable are getting mapped

@Harshal Aditya  I see only redirect URL in script of record producer
producer.portal_redirect =XXXX+Current sys_id...etc


I created another variable in another varrible set(non-multirow)
I can write CS which can merge :all rows in format like
Row1.2, row1.2; row2.1,row2.2;row3.1,row3.2;

In My CS

var rowcount = procucer.variable 1 of murltorow var set.length;
alert (rowcount);
g_form.addInfoMessage(rowcount);
var obj = (g_form.getValue('murltorow var set name').length != 0) ? JSON.parse(g_form.getValue('murltorow var set name')): [];
alert (obj);

 

g_form.setValue('var in which i want to merger all rows in format mentioned above', JSON.stringify(obj));

@Harshal Aditya  Format I need is : data value test 1 #data value of test 2

 consider test1 and test2 are two variable in mrvs

 

@Ankur Bawiskar  After JSON.stringify(obj); it is coming like: field name of test 1 : data value, field name of test 2:Value. : expected format-data value test 1 #data value of test 2
Please advice.