Hi, trying my hand at some node.js actions \ scriptable tasks in VRO 8.8.
I am struggling to find away to return \ pass data from task to the next.
I have a workflow with 2 scriptable tasks, task1 has a single input call execTime and a single output called output. These are both defined as variables in the workflow and liked accordingly to the scriptable task. I have tried using return output, return variable_goes_here. But I can not get this to what I want.
Below is a simple bit of code without any return. What would I need to do to get the code to return one of the date variables.
Also what is the purpose of the callback, I see nothing about this documented anywhere I looked.
exports.handler = (context, inputs, callback) => {
console.log('Inputs were ' + JSON.stringify(inputs));
console.log('Inputs were ' + JSON.stringify(context));
console.log(typeof inputs.execTime);
var nyDate = new Date(inputs.execTime).toLocaleString('en-gb', {
year: 'numeric',
month: 'long',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
timeZone: 'America/New_York'
});
var zarDate = new Date(inputs.execTime).toLocaleString('en-gb', {
year: 'numeric',
month: 'long',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
timeZone: 'Africa/Johannesburg'
});
var jpnDate = new Date(inputs.execTime).toLocaleString('en-gb', {
year: 'numeric',
month: 'long',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
timeZone: 'Asia/Tokyo'
});
console.log(nyDate)
console.log(zarDate);
console.log(jpnDate);
callback(undefined, {status: "done"});
}