Retuning multiple variables with Zapier

  • 0
  • Pump00:00

I need to be able to return a few variables based on a code. If code A then return these. If Code B then return these. In no code, return these.

This is what I have so far.

if (inputData.code === 'WSDCD-D2DUK') {
  output = 'Company A';
} else if (inputData.code === '6P1CX-5U2TY'){
  output = 'Company B';
}
else {
  output = 'Not Avaliable';
}

return {result: output};

And what I need is something like this:

if (inputData.code === 'WSDCD-D2DUK') {
  output = 'Company A';
  course = 'ABC'
} else if (inputData.code === '6P1CX-5U2TY'){
  output = 'Company B';
  course = 'XYZ'
}
else {
  output = 'Not Avaliable';
  course = 'Not in one';
}

return {result: output, course};
Default Asked on December 28, 2019 in Programming.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.