Best answer

Got a result missing the "id" property

  • 9 November 2021
  • 1 reply
  • 19 views

- Got a result missing the "id" property ({"account_number":"#####","resource":"954###9425","message_id":11531576,"content":"","from":"Anonymous","first_name":"","last_name":"","created_at":"Oct 25","utc_created_at":"2021-10-25T18:5

 

How do I fix this error? We currently do not use the id property we use message_id.

const options = {

  url: '##',

  method: 'GET',

  headers: {

    'X-API-EMAIL': bundle.authData.api_email,

    'X-API-TOKEN': bundle.authData.api_key

  },

  params: {

    'api_email': bundle.authData.api_email,

    'api_key': bundle.authData.api_key

  }

}

return z.request(options)

  .then((response) => {

    response.throwForStatus();

    const results = response.json;

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

  return results;

  });

icon

Best answer by Zane 10 November 2021, 18:02

View original

1 reply

Userlevel 7
Badge +9

Zapier looks for a field explicitly named id to find a unique identifier for the object, so that we can avoid processing the same object more than once. If your unique identifier is named something other than `id`, you’ll add a new field named `id` and assign it the unique value prior to returning your result.

Something like...

return results.map((item)=>{



  item.id = item.message_id;



  return item;

}));

Reply