Nested Repeating Groups & Filters

Hi,

I have two repeating groups, one nested within the other.

I’d like to filter/limit what displays in the nested repeating group by referencing the first.

I’ve had some success in this so far but can’t complete it yet. I’ve tried a lot - but I think there must be a method I’m not familiar with yet.

I’ve built an example in the app forum – there are more details about the nature of the problem there: https://forumapp3.bubbleapps.io/version-test/repeatinggroupq?debug_mode=true .

The gist of my question is, how do you filter the second RG to show material IN BETWEEN certain cells in that RG2, where the starting and end points are defined by what appears in RG1?

As mentioned, there are many more details on the forum app page – any help is really appreciated!!

Thank you!
P

Can you give the link to the editor please ?

Hi, rookie mistake - https://bubble.io/page?type=page&name=repeatinggroupq&id=forumapp3&tab=tabs-1 . That’s the editor link. Sorry 'bout that.

P

Thanks, just wanted to make sure had the right page :slight_smile:

So I think what you need to do is add on a field “Animal” to the Animal Info. So something that says “this info is about this Animal thing”.

So not the text, but that actual thing on the Animals data type.

You will notice it has type “Animals”.

I have updated a few things to demonstrate.

Unless your data really does need to be structured in the <Ant-eater, word, word, word, Elephant, word etc> way. But that does seem a little odd.

Hi Nigel,

Thanks for this suggestion.

How do you envision the texts being ‘linked’ to an animal in the DB? For example, did you manually edit the DB to have ‘ant-eater’ associated with those 3 texts?

I need a way for this to happen automatically. We won’t be creating the text infos in question - they’ll be fetched by an API. Our job is to take this data and ‘match’ it to the materials in RG1. There will be hundreds of items in RG1 and thousands of items, changing on a daily basis, in RG2. Manually tagging these in the DB is not possible, I’d gladly use your suggested method if there’s a way to ‘automatically’ associate the texts with the animal in the DB. Any idea?

I had originally thought that the approach of using a filter – one that says ‘display all texts between x and y [elephant and parrot] and display it in cell z’ – was the way to go. I just don’t know how to do that using Bubble. Having seen your suggested solution, I suppose there might be a way to ‘automatically’ tag everything (the texts) ‘in between’ animal types… But that, too, seems to rely on some kind of filter of the sort described above.

Thoughts?

Best,
P

Ah, ok. So the texts will be coming in just like that ?

So between names of animals ?

Yes - between animals.

So:

Ant-eater – Verbiage
goes
in
between
the
animal
types
and

Elephant – only
the
information
for
each
animal
type

Parrot - [etc.]

What do you think?

Thank you!
P

Looks very hard to do in a repeating group. Will have a ponder.

Ok - also willing to do it via some other mechanism. For example, I’d be happy to have a text box if that a would work. Or iFrame. Etc.

Thanks for pondering this!

P

The problem is that it so dependent on having the data in the right order. What if you don’t start with an animal, what if you never get an animal, what if you get two the same one after the other ?

How is this data coming in in the first place ? That is where to try to organise it I think.

Good questions.

First questions: the nature of the RG2 material is such that it always references the material appearing in RG1. The RG2 material must have at least some of the animals from RG1 in its texts – this is the very nature of the data. How do I know? This is niche government data, highly structured, has followed this format for decades (i.e. pre-digitization), and the material in the 2nd RG necessarily references the material in the first RG b/c the 2nd data set is created by the government specifically for this purpose (we’re not actually dealing with animals in our data sets, it’s just a convenient way to simplify this).

As for your second question – whether two animals might appear one after the other – this is a possibility. However, consecutive animals will be always separated by commas… whereas animals appearing only one at a time never do. We could exclude these animal-lists by omitting animal + comma. There are also additional things we can do.

For now, I’d be happy just to get the texts in between these animals appearing and even if there are complications such as multiple animals and so on that this first step didn’t address, I’m confident we could get there with subsequent steps. It’s this piece of getting the in-between data to show in the right cells that’s giving me grief. :slight_smile:

Finally - if none of this persuades you that the issue is not so much with how the data is initially captured, then let’s explore that. Currently the data is being imported manually via API. We could do it via CSV but this is not at all ideal due to the non-automated dimension of such ‘downloading’ the data into CSV, cleaning all the data, and so on. However… perhaps as per your solution of attaching ‘animal’ to the text data, perhaps there is an efficient way to attach the correct animals to the texts within the CSV before uploading it.

Again - I’d far rather do it via API then parsing through RGs (or text box, and so on).

Thoughts?

P