Best answer

Got a non-object result in the array

  • 26 December 2021
  • 8 replies
  • 700 views

Hi, I’m trying to integrate Facebook Lead to my CRM via the Zapier platform.

unfortunately, in the trigger’s step, I got an error about the return type of my request, so I turn to code mode and turn the return type to be an array.

Now, I got an other error: “Got a non-object result in the array” and I really don't know what I’m not doing good, can you help me please ? 

 

 

Invalid API Response:

- Got a non-object result in the array, expected only objects ([{"id":XXXXXXXXX,"total_leads":XXXX,"assigned_to":nu) - Got a result missing the "id" property ([{"id":XXXXXXXX,"total_leads":XXXX,"assigned_to":null,"domain_uuid":"XXXXXXXXXXXXXXXXXXXXXXXXXXXX","created_by":null,"created_at":1640512122,"updated_at":1640512122,"module":{"id":XXXX,"tags":[],"fields":[{"id":XXXXX,"domain_uuid":"XXXXXXXXXXX) What happened (You are seeing this because you are an admin): Executing triggers.get_data.operation.perform with bundle Invalid API Response: - Got a non-object result in the array, expected only objects ([{"id":XXXXXXXXX,"total_leads":XXXX,"assigned_to":nu) - Got a result missing the "id" property ([{"id":XXXXXXXXX,"total_leads":XXXX,"assigned_to":null,"domain_uuid":"XXXXXXXXXXXXXXXXXXXXXXXXX","created_by":null,"created_at":1640512122,"updated_at":1640512122,"module":{"id":XXXX,"tags":[],"fields":[{"id":XXXXX,"domain_uuid":"XXXXXXXX)

icon

Best answer by mzsadiek 29 December 2021, 12:15

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

8 replies

Userlevel 7
Badge +14

Hi @Israel Mimouni 

Can you please post screenshots with how your Zap steps are configured, thanks.

Hi, yes, of course: 

Authentication 

Triggers

Actions

Do you need something else in order to help me find out what wrong in my setup ? 

Thank you very much !

 

Userlevel 3
Badge +4

Hi @Israel Mimouni! I just responded to your other topic because I hadn’t seen this one. Take a look at this thread, as it looks similiar to your problem: 

 

HI @mzsadiek , I just tried it and got an other error message : “Got a result missing the "id" property ”.

Right now, I try to follow the responses of someone how ask about the same issue, if you have any idea that can help me, I will very thanks full! 

This is my current code :

const options = {
  url: 'https://api.kavkom.com/api/crm/v1/lead/list',
  method: 'GET',
  headers: {
    'X-API-TOKEN': bundle.authData["X-API-TOKEN"],
    'Accept': ["application/json"],
    'Content-Type': ["application/json"]
  },
  params: {
    'domain_uuid': bundle.authData["domain_uuid"],
    'limit': '1'
  }
};

 return z.request(options).then((response) => {
 response.throwForStatus();
 const result = z.JSON.parse(response.content);
 result.id = result.ID;
 return [result];
});

Userlevel 7
Badge +12

Hi @Israel Mimouni 

Assuming your ‘results’ variable is like the attached
const results = response.json;

return [results.data]

 

Userlevel 7
Badge +12

Hi @Israel Mimouni!

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.. There’s more information about that and an example in the answer to this post: