In Dropsource you can display data from an array in an API response using dynamic Elements, such as Tables. This allows you to create page designs that will populate with the required number of display Elements when the API response is received. With the API request added to your page:
- Add a Table Element to the page.
In Properties, select Dynamic from the Content/Type drop-down list.
- Add a Table Cell inside the Table (drop it on top of the Table).
- Add Elements inside the Table Cell to display the fields inside the API response array (e.g. Text Views, Labels).
- Open your request and select the Responses section.
Arrays will be listed as Data Sources – find the Data Source you want to display and bind it to the Table (click and drag it onto the Table on the Canvas, or click it and select the Table from the Elements container).
Fields inside the array will be nested under the Data Source – bind the fields you want to display, to the Elements you added inside the Table Cell (click and drag them onto the Elements on the Canvas, or click them and select from the Elements container).
If your array includes image URLs you want to display, you will need to use the Table Cell Loaded Event. Events on the Table Cell can access the data from the array entry bound to it. You can also iterate through the array if you need to carry out processing on it.