from dataset
expression_macros.xml
{
var output;
if ($job.remove_newlines || $job.param_type != 'text') {
$job.input1.contents = $job.input1.contents.trim();
}
if ($job.param_type == 'integer') {
output = parseInt($job.input1.contents);
} else if ($job.param_type == 'float') {
output = parseFloat($job.input1.contents);
} else if ($job.param_type == 'boolean') {
const trueValues = ['yes', 'true', '1']
const falseValues = ['no', 'false', '0']
let lowerCaseContents = $job.input1.contents.toLowerCase();
if (trueValues.includes(lowerCaseContents)) {
output = true;
} else if (falseValues.includes(lowerCaseContents)) {
output = false;
}
else {
return 'NOT A BOOLEAN VALUE';
}
} else {
output = $job.input1.contents;
}
return {'output': output};
}