Skip to main content

Hi all,

 

I'm attempting to handle a response from my company's api that I'm getting through Zapier. Our api returns {"status":"SUCCESS","description":"","result": etc. etc.

I'm getting 2 error messages

1. Results must be an array

2. Got a result missing the "id" property

 

I have tried this as a solution based on other conversations I saw on here.

 

return z.request(options)

  .then((response) => {

    //response.throwForStatus();

    // You can do any parsing you need for results here before returning them

    const myJson = response.json;

    const justResults = myJson.result;

    const results = njustResults];

    //results.throwForStatus();

    return results;

  });

 

I would expect this to work because results contains an id field, and I'm returning an array. I'm still getting those error messages even though I've refreshed my logs. Does anyone know what's causing this? I'm still getting:

 

- Results must be an array, got: object, ({"status":"SUCCESS","description":"","result":{"la) 

- Got a result missing the "id" property ("SUCCESS")

 

Thanks,

For some reason this seems to have worked for me:

 

return z.request(options)
  .then((response) => {
    //response.throwForStatus();
    // You can do any parsing you need for results here before returning them
    z.console.log('response');
    z.console.log(response);
   return Âresponse.json.result]
  });


Reply