Forum Documentation Showcase Pricing Learn more

Repeating group filter based on 2 different databases

HI

I have 2 databases
1 “Basic Sample information” containing(MonsterBasis)

  • Unique Sample ID
  • Name grower
  • Variety

2"Measurement results" containing: (monstermetingen)

  • Unique Sample ID
  • Unique measurement ID

I have a selection field for Grower

Now I want my repeating group of measurement results filtered by Grower!
I know how to set up the filtering in the RG for the same thing (like Ras, Type monster and Mutant), but not for an other thing, I can’t figure it out…

I have tried a lot but I need the help of one of the colleague bubblers…

This Is what I have at the moment:

Thanks a lot for your help!
Marco

anyone that give me a push in the right direction?

Your advise is much appreciated!!
marco

It looks like the field that’s common between each is Unique Sample ID, correct?

In bubble they call each of these data types. In more generic terminology that applies to all relational databases, these two things would be called tables.

So it sounds like you have two data types in your app’s database and you are looking to match the results from each using a common field called Unique Sample ID

Look up the filter option in bubble.

In your case this might look like

Do a Search For Monstermetingen:filter

Under Filter
Advanced : Do Search For MonsterBasis

Under Do A Search For MonsterBasis
Unique Sample ID: This Monstermetingen’s Unique Sample ID
Name grower: 'Input Name of Grower’s Value`

Another thing you might want to consider is creating a new separate data type in addition to monstermetingen & MonsterBasis in your database. In this case, you would add a have monstermetingen & MonsterBasis & samples.

The Samples datatype would contain all of the Unique Sample IDs. Then, you could associate the other data type (monstermetingen & MonsterBasis) with each sample.

There are some advantages to this

  • This avoids a potential inconsistency between Unique Sample IDs that can sometime occur if you aren’t very diligent about how you are updating your db in your app.
    The way it avoids this is that monstermetingen & MonsterBasis since they both now reference the same DB entry.
  • Its allows for a faster searching and a more streamlined approach when writing out your expressions.

Thanks a lot @jon2 for your reaction and clear explanation!

I’m try to do the first part first…
but I’m lost somewhere here:

Do a Search For Monstermetingen:filter

Under Filter
Advanced : Do Search For MonsterBasis

Under Do A Search For MonsterBasis`

This part is nut clear enough for me where and how to fill in:
Unique Sample ID : This Monstermetingen’s Unique Sample ID
Name grower : 'Input Name of Grower’s Value`

This is what I did:


I can’t only put: Advanced: Search for MonsterBasis

Could you please help me with the last part as I think I’m close by the solution…

About the second part I’m also very interested how to set up that way.
I found out the bubble is not very fast in showing “search by” results

How do I made the association?
data Type Samples
Field UniqueMeasurementID (=Monstermetingen Unique Measurement ID)
Field UniqueSampleID (=MonsterBasis Unique Sample ID)

So every time a measurement is entered I will update the measurement thing (as I do know) AND the Sample thing as above?

Thanks again for your help!
Marco

How do I made the association?
data Type Samples
Field UniqueMeasurementID (=Monstermetingen Unique Measurement ID)
Field UniqueSampleID (=MonsterBasis Unique Sample ID)

When you create a database field, you may set the field type to text, number, date, etc. You can also set the type to another data type (table) in your database such as Monstermetingen or MonsterBasis. These are called ‘custom types’ and are other things in your database.

Your custom types are found below the built-in types. Scroll down to the bottom to find your custom types when selecting the field type from the dropdown.

As far as how you associate them.
You can do this manually in the data tab under ‘app data’ in the bubble editor. In practice, you’ll want to be able to do this in your app too. For example: In your bubble workflows you can:

Step 1) create a sample thing in one step
Step 2) update a MonsterBasis thing
MonsterBasis's associated Sample = Result of Step 1 Create A Sample
Step 3) update a MonsterMeetingen
MonsterMeetingen's associated Sample = Result of Step 1 Create A Sample

What you’ve got going on here with Samples is slightly beyond the basics of just storing stuff in the db. Samples is a ‘carrier data type’ which the things inside do not really store much on their own, but really function to store the relationship between two other things MonsterMeetingen and MonsterBasis

You’ll likely want to learn more about the basics of relational databases. I’d highly recommend checking out Salar’s Udemy Course to which covers more more on the database and this kind of thing.