Extract a single Variable value as a string

var VALS = Table_2.getDataSource().getVariableValues("VARIABLE NAME")[0];
var VALS2=cast(Type.SingleVariableValue,VALS);
var VALS3=VALS2.value;
console.log(VALS3);
//VALS3 is returned as a string value – so can be used in text boxes etc



/*
// you could wrap the entire code into a single line

var Value=cast(Type.SingleVariableValue,Table_2.getDataSource().getVariableValues("VARIABLE_NAME")[0]).value;
console.log(Value);

*/

Code language: JavaScript (javascript)
Scroll to Top