Retrieve API data in 2 levels into a table

Hi all,

We have a API answer that give us data in this format.
root
[0] 18 keys
field1
field2
[0] 12 keys
field1
....
field12
[...]
[12] 12 keys
field1
....
field12
[...]
[18]

etc...
I would like to show data of all items in level 1 recursivelly but now I can only show for the 1st iteration, [0] 12 keys, and not do it for the [0]...[18] of the 1st level , how I can point table to do it recursivelly?

Hey @Oscar_Junyent_Matabosch! Could you clarify a bit more about what you mean by recursively in this case?

Would you like to grab field1 from every level?

Hi Victoria,
Thanks for your reply.

Please see below an example of the JSON I'm working with. What I want is to show in a table the second level, so all matches for id 1 plus id 2 etc, so working recurrently in al matches level and list all for all competitions

{
"competition": [
{
"id": "1",
"name": "Primera División",
"alias": "primera",
"completeName": "Primera División",
"completeAlias": "primera",
"matches": [
{
"finished": "1",
"t1_name": "Barcelona",
"t2_name": "Rayo Vallecano",
"stadium": "Spotify Camp Nou",
}
},
{

      "finished": "1",
      "t1_name": "R. Sociedad",
      "t2_name": "Barcelona",
       "stadium": "Reale Arena",
      }
    },
{
  "id": "2",
  "name": "Champions League",
  "alias": "champions",
  "completeName": " Champions League ",
  "completeAlias": "champions",
  "matches": [
    {
      "finished": "1",
      "t1_name": "Barcelona",
      "t2_name": "Bayern",
       "stadium": "Spotify Camp Nou",
      }
    },
    {
      
      "finished": "1",
      "t1_name": "Manchester",
      "t2_name": "Barcelona",
       "stadium": "OldTrafford",
      }
    },

}
}

Thank you for sending that! I pasted it in my app (and changed some of the brackets to prevent errors) and this code was able to get just the matches:

{{ _.flatten(query2.data.competition.map(obj => obj.matches)) }} 

Is this closer to what you're looking for? :slight_smile: :crossed_fingers:

It works!!!

Many thanks for the tip!