Skip to main content
← Data, API & Backend
Data, API & Backend September 1, 2024 · 2 replies

Incorrect response structure in API call

Archived from the Bravo community forum (2021–2026). Some answers may refer to older versions of Bravo.

Hi all!

I’m running into a small issue when I set up an API request for a list endpoint with my custom backend. The response includes a `results` attribute at the top level which is an array and I can select `All` the elements. The problem comes with the arrays that are in nested levels in the response. For some reason they don’t show the `All` option, but rather I can only select a specific element in the list.

Does anyone know why this might be happening?

Thank you in advance!

2 replies

Toby Oliver Bravo team September 1, 2024

The issue is that you can’t nest arrays arrays you can only have 1 so you can either choose an element of results and get the array of images or do what you have now which is an array of results and then choose an image. If you need both you need to flatten the data and unnest the arrays.

Ramon September 1, 2024

So if I want to have a list page where I show a product name and a group of images for each product, I need to make a request individually for each product to get the images?

Wrote something in this thread and want it removed? Request removal

Still stuck?

Ask the community on Discord

This archive is read-only. New questions, office hours and product updates now happen in the Bravo Discord.

Join the Discord