Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 04:21 AM
Hello,
I'm trying to map several variables to the same table field using the record producer's script. I'm using the following script as an example:
//current.table_field += producer.variable1;
//current.table_field += producer.variable3;
//current.table_field += producer.variable3;
However, I'm having difficulties separating the values on different lines and with the variable name before the value. Is it possible to do it, and how ?
Please check attached images: Print1 is how it is right now, Print2 is how I want it to be
Thank you in advance,
Diogo
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 04:42 AM
Try adding below script in Record Porducer script section.
var desc='';
var variables = [producer.variable_name1,producer.variable_name2,producer.variable_name3];
for (var i=0;i<variables.length;i++) {
var question = variables[i].getQuestion();
var label = question.getLabel();
var value = question.getDisplayValue();
if(label != '' && value != ''){
desc+= label +": "+ value +"\n" +"\n";
}
}
//Setting All variable lables and values in description filed
current.description=desc;
Thanks,
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 04:42 AM
Try adding below script in Record Porducer script section.
var desc='';
var variables = [producer.variable_name1,producer.variable_name2,producer.variable_name3];
for (var i=0;i<variables.length;i++) {
var question = variables[i].getQuestion();
var label = question.getLabel();
var value = question.getDisplayValue();
if(label != '' && value != ''){
desc+= label +": "+ value +"\n" +"\n";
}
}
//Setting All variable lables and values in description filed
current.description=desc;
Thanks,
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 08:26 AM
It worked perfectly, thank you for your help 🙂