[Resolved] Build fails when using Iterate Through Array action on a list field


#1

My apps fail to build whenever I use Iterate through Array action on a list field.

For example if I have a table say User with fields age (integer), name(string) and likes (lists of strings).
Calling the action Iterate through Array and passing my array field (likes) as the list for the action in the 200 response, always causes the build to fail.

I’ve tested in different apps and different databases and it’s the same results.

This is on Android, haven’t tested on IOS yet.


#2

Hi @seanhoots, are you using it on an array inside an array? If it’s an array inside an array bound to a table I’d try using the action in the table cell / list tile load event instead of the 200 event if that makes sense.


#3

Hi @sue, it is an array inside a single response object and i’m not binding this to table.
Again here lets say my table structure is like this

User
  unique id - string
   name - string
   age - number
   likes - list of strings

And i make a call to the endpoint obj/user/{uniqueid} and it returns a row of user like this

{
  "unique id" : "123456",
  "name" : "John Doe",
  "age" : 22,
  "likes" : ["mango","pear","orange"]
}

What i want to do is to call the Iterate through Array action and pass it the likes list so that i can check if this list contains say orange.


#4

Ah I thought you meant it was in an array bound to a table… So I’m not sure if this will work in the Dropsource action:

"likes" : ["mango","pear","orange"]

Can you share a screenshot of how that structure appears in your Responses section in the editor?


#5

I haven’t validated this but I’m wondering if it only works on arrays of objects, each object having a key value pair inside it at a minimum.


#6

Here is the response structure

Then in the 200 response I add the Iterate through Array action.
At this point the build works.

But when i add an action to access an item in the array like below then the build fails.


#7

I’ve asked for some clarification from engineering but think I have only used the iterate action on arrays of objects, e.g.

"likes" : [{"name":"mango"},{"name":"pear"},{"name":"orange"}]


#8

Hi @seanhoots, it sounds like your structure should work in Dropsource, could you forward me a build ID so our engineers can look into it?


#9

Thanks @sue, yes technically i expect this to work since i’m able to successfully interate a list of objects so i don’t see why interating through a list of strings shouldn’t work.

I’ve PM’ed you the build fail ID.


#10

Hey @seanhoots, I looked into this issue and it is indeed a bug on our end. I believe I’ve found a fix for it. We’re going to test it our internally for a bit and hopefully release a hotfix later today. Thanks for the help!


#11

Hey Sean, thanks a lot for looking into this.
Will be waiting for the fix.


#12

Alrighty the fix has been deployed. When you get a chance could you try running the build again?


#13

Works perfectly :tada:
Thanks @scheatham and @sue.