Xano Connector Trigger Action is giving TypeError: undefined is not iterable when updating user byuser_id

Hi, I am using Xano connector in bubble. When I need to update user using its user_id i’m getting TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator)) error. Can you figure what is the possible solution as the api works fine when I hit it on postman.


Hi Waleed.
I am getting the same error multiple places.
Did you figure out a solution?

@eli @jared.gibb do you have a solution for this error?

Unfortunately no, I don’t have a solution right now. Still waiting for reply from @eli

Hey @waleed.mudassar and @cgt1994. I missed this post earlier so apologies for the delayed response.

This is a known issue but it does have a solution. I’ve made a walkthrough going through exactly what is causing the error and how to fix it here

4 Likes

Hi -

In Eli’s example, if you really need the role field but sometimes it is empty, make sure that you define the array at creation. The issue surfaces when bubble receives “null” instead of an array. So if your value could be just an empty array, you just have to make sure that when you create an object in Xano, you surely fill it with “[]”. If you do that, Bubble will get an array (even when it is empty) and be happy

2 Likes

Thank you so much @eli ! :pray:

Thanks @klaas.vanhoeck1 !

@klaas.vanhoeck1 I am now in the situation where I have an array that it is meant to be empty and I get the error. Can you elaborate on how I make sure that Xano gets the “[]” and doesn’t try to return “null”?

Can you verify that Xano does send the null value instead of the []?

I don’t see it specifically saying null in the return. I just keep getting the same “TypeError: undefined is not iterable”. Do you think something else could be wrong?

Does your array also contains a nested array? because then it could be it is complaining that it can’t find the second array.

1 Like

@cgt1994 It’s helpful for debugging if you can make a loom showing the response you have setup in the API connector and then also showing the response being returned from Xano from an actual request.

So go to the API endpoint in Xano, click the three dots in the top right, click ‘Request History’ and then drill into the request and show the ‘Output’. The output will show you exactly whats being returned to your app.



@eli @klaas.vanhoeck1
I have a loom for you here where you can see the xano requests:

Please just let me know if I can provide any more information.
By the way, I checked the console and the error did occur twice.

@cgt1994 Can you provide the JSON you’ve set up in the API connector as well?

Also a quick note, the Xano response you showed is for a POST that only returns a single object. I imagine you have a separate GET endpoint you are calling that returns an array of records to populate your repeating group. Make sure you are checking the response on that call as well.

So maybe another loom that shows the API connector setup for both those responses and the Xano responses for that GET endpoint