Formatting API Data that is an array in a table?

I am working with a simple API that returns some data as an array. I am trying to display the data in a table. The results from the API that are not part of the array look fine and the array data show up as Object, Object. I know I need to use the data format but I’m just not sure how or where to find an instruction that tells me the needed steps.
This is what the current field looks like:


You can see the two fields that contain the array data. I want to have the array displayed in the same field one after another.

Hopefully, someone can point me in the correct direction. I have tried to figure it out but can’t get it to work

thank you,

Are you sure you’re getting api.data? Looks to me you’re just getting the variable “api”, which is an Object

Can’t say for sure without seeing the code/steps

To see the underlying JSON being returned, use the browser inspect -> Network tab and you can see that raw data.

I think this is what you were asking for. It shows that I am getting the data back but I think its just that I don’t know how to format it for the table?

Yes. It shows you have an embedded array in the JSON called ‘sources’. You can bind this array to an embedded repeat to list the individual elements. To ensure it can be seen in the Wappler UI to enable this visually, make sure the schema is defined in the server-connect API request.

Thank you, This is where I am unsure how to proceed? Is there somewhere that shows the correct way to set this up using the wappler formating tool?

Remove the dmx-text from the <td> and create a repeat region using this array inside the <td> </td> then inside this repeat you can bind the data you need.

thank you, would you happen to have an example I can look at?

Pretty much the same as what’s explained in the second half of this tutorial:

1 Like