Error message: Cannot convert undefined or null value to object (throttled)
I am trying to create a post request that returns an array of gross pay items. I thought I did it correctly and it said that my request was successful, but seconds later I got this big red alert that said “Cannot convert undefined or null value to object (throttled).”
I have attached the return code I am using and the model of the data it should be returning. I also attached a photo of the error message. Does anyone have any idea what is going on here?
Page 1 / 1
@jacob_nolley - Try to `z.console.log(results)`. Is it an object or a null/empty response? You probably need to check if the response is an object before returning it. Otherwise just return an empty array if it’s a search action, or an empty object if it’s a create action.
Do you mean like this? I tried this and I got the same result. It is a Search action. Is there a way to specify that an empty array is okay?
@jacob_nolley - Here’s what I meant:
const results = z.JSON.parse(response.content);
z.console.log(results); // <--- Here
return results;
To answer your question, you should actually check if the result is an array, like this:
I received ] as a response. Do you know how I could fix this?
@jacob_nolley - Can you post any console logs you got when you used `z.console.log` as I mentioned earlier? It’s important to see what the API response looks like exactly.
@ikbelkirasan
When I do the z.console.log, it says “no logs to show”
Hi @jacob_nolley - were you able to get to the bottom of this one? If not please let me know and I can ask the Support Team to take a look for you.
Heyy @Danvers,
I fortunately I didnt. Instead, I just implemented a work around and have been able to get that to work!
Thank you,
Jacob
Thanks for letting us know, I’m glad that you were able to find a workaround