How can I get values of a multi line variable set from a client script in a record producer?

EvilRojo
Tera Expert

How can I obtain values from a multi line variable set from a client script of type onsubmit in a record producer? I want to save its values in another field, but I need the values that have been entered into the variable set regardless of the number of rows that the variable has. set variable

1 ACCEPTED SOLUTION

Brad Bowman
Kilo Patron
Kilo Patron
g_form.getValue('mrvs_internal_name');

Will give you the JSON-formatted string of variable names and values - one set for each row.  You can dump that into a multi-line text variable as is, or parse it and make it more legible if you'd like

View solution in original post

2 REPLIES 2

Brad Bowman
Kilo Patron
Kilo Patron
g_form.getValue('mrvs_internal_name');

Will give you the JSON-formatted string of variable names and values - one set for each row.  You can dump that into a multi-line text variable as is, or parse it and make it more legible if you'd like

jMarshal
Mega Sage
Mega Sage

I believe the data is stored in JSON format and you'll need to parse it out - Inside record producer script, how to access data of a MRVS variable so that its data can be copied ...

For example:

 

var extractedData = [];
var mrvs = JSON.parse(current.variables.multi_row_variable_set_name);
for (var r in mrvs) {
	var row = mrvs[r];
	var dataElement = row.mrvs_variable_name;	
	extractedData.push(dataElement);
	if (row.variableName == 'condition') {
		processData(); //whatever funciton or script you want to use to manipulate/handle the data
		} 
	}