- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2023 10:44 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2023 10:50 AM - edited ‎11-24-2023 10:52 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2023 10:50 AM - edited ‎11-24-2023 10:52 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2023 10:59 AM - edited ‎11-24-2023 11:00 AM
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
}
}