I'm working on parsing the response from a webservice using the embedded variable functions. In this case I want to parse the data return, i.e. ~{ch://OCAC_27xIryFGKDjjlxp/data}.
If I take the known result and paste it into the code, and click the "Test Code" button, it works exactly as expected. When it executes via the workflow, it throws an error of "Unexpected token )".
Here is the code I am using:
function codeTask() {
const data = ~{ch://OCAC_27xIryFGKDjjlxp/data}
var raw = data.substring(5);
console.log(raw)
const jsonData = JSON.parse(raw);
return {
"result": jsonData.version
}
}
Any ideas on this one?
Custom Code Task failing
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.