Repeated list within repeated list

Hello, I’m stuck in building a repeated container list that contains a repeated list.
The data structure looks like this (Firestore):

The goal is to build a repeated container and display the ids 1-n, and inside each container display the subids 1-n.

I’m able to repeat the ids 1-n, however I’m struggling with the subids. If I repeat them as well within the “collection repeat container”, the subids displayed in every container will be the same.

I’m looking for a way to pass the collection information to the repeat of the subcollection.

Hope it was somehow understandably explained. Let me know if you need more information :slight_smile:

Little bump on this…

Hi, check out this post for an example of nested repeats:

@Mari: Can you please show me this step by step? With the tutorial I cannot make it happen… :confused:

Hi, if I’m repeating a list of clothes with titles and a list of colors:

I will first repeat the whole container as item

Then I will repeat the text inside with item.colors as color and bind the value of the text to

1 Like

@Mari: thank you but in this example you are using one single object.
In my example above I have two different objects:

collection/id —> one object containing

id1, id2,… idn

collection/id/subcollection/subid —> one object containing
subid1, subid2., … subidn

so the first collection has no subid data in its .json and the subcollection has no id data in its .json.

do you know what I mean? if not, I can also show you the .json files from firestore

Hi, it would help to know what format is your data in – in my example the data is comprised of lists of objects.

Both collection are objects in Firestore:


Sub collection:

Okay, and how are you bringing these into Composer? Are they in separate data variables? How does the subcollection reference which collection it belongs to or the collection reference which subcollections are part of it? :thinking:

I have them stored in two separate data variables.
However, I don’t know how to solve the reference part. Each subcollection has the collection id stored in the “name” field. Any tips in how I can implement this in a repeated list?

To find the right subcollection objects, you could use SELECT(data.subcollections, CONTAINS(, if is the name of the repeated parent collection. → Select all from subcollections where the item name contains the current collection’s name