Quantcast
Channel: [Q&A - FAQ Neotys] Last questions
Viewing all articles
Browse latest Browse all 2283

Extracted variables in js scripts

$
0
0

Hi all,
I created a script to construct a new variable (text) thanks to multiple extracted variables (ID, NUM, DATE).

I am able to see the new variable on debug log.
But the value return by the function is null.

Please help.

*** SCRIPT START ***
function evaluate () {
var i = 1;
var text = "";
var max = context.variableManager.getValue("ID_matchNr");

while (i <= max) {
var value1 = "ID_"+i; //Extracted variable ID
var value2 = "NUM_"+i; //Extracted variable NUM
var value3 = "DATE_"+i; //Extracted variable DATE

var value_id = context.variableManager.getValue(value1);
var value_num = context.variableManager.getValue(value2);
var value_date = context.variableManager.getValue(value3);

text += "{\"id\":"+value_id+",\"num\":"+value_num+",\"date\":"+value_date+"}";

if (i<myvalue) {
text += ",";
}

i++;
}

logger.debug(text);
return text;
}
*** END SCRIPT ***


Viewing all articles
Browse latest Browse all 2283

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>