How to access a nested list of objects in one call?

Hello,
I need to send a get request to my own API and get data with nested list of object details (not just ids)
So I think I can achieve this by creating a back-end workflow that can fetch data in 2 steps.
I’ve already done this using the “Return Data from API” method but it returns the first object or a specific object in the list. When I tried the “Schedule an API workflow on a list” method It would go through the list successfully because it gives me a response with the same number of items in the list but it doesn’t return any useful data, instead, it always returns some weird numbers I think someone mentioned here is the request ids.

If you have a way to achieve this please help.

Screen Shot 1444-06-11 at 6.03.55 PM

Screen Shot 1444-06-11 at 6.04.26 PM

Hi @boonfull2020,

It sounds like you are trying to fetch data from a list of objects using an API workflow in Bubble. To do this, you can use the “For each” loop in your API workflow to iterate over the list of objects and make a separate API request for each object. Here is an example of how you can set this up:

  1. In your API workflow, use the “For each” loop to iterate over the list of objects that you want to fetch data for.
  2. Inside the “For each” loop, use the “Make a request” action to make an API request to your API endpoint for each object.
  3. Use the “Return data from API” action to parse the response and extract the data that you want to return for each object.
  4. In the “Return data from API” action, you can use the “Append to list” option to add the data for each object to a list that you can return as the output of the API workflow.

This way, you can make a separate API request for each object in the list and return a list of data for each object in the response.

I am sorry but where can I find “For each” action?

Please check DM @boonfull2020. Thanks.

If you can share the api response that bubble gets when initializing the api connector it’s easier to help you. Of course you can hide any sensible data.

not in bubble :man_shrugging:

Hey @boonfull2020, have you find a solution ? I’m struggling with this aswell…

the format as text bubble syntax is a for loop

hey there…
One of my colleagues found a solution to our problem and it was very easy…
since I am still in the app I can use “do a search for” instead of using the API to fetch order_items

this gave me the response I needed with the items details

here How to access a nested list of objects in one call? - #9 by boonfull2020

1 Like