How to work relationship between database

Hi ,

I have created 2 databases (Product , Size).
I have linked them
When I click on a product I want to see on detail screen the associated sizes.
For this, On detail screen , I use a simple list component and a filter based on relationship.
But size component is empty.
What is wrong ?
Any help is appreciated.

image



Solved by using a custom filter.
(But I don’t yet understand why using the relationship doesn’t work in my case)
image

Hi @zephir,

Welcome to the community :partying_face:

Before adding the custom filter the normal filter was current product> sizes right? That doesn’t worked because I see that in your sizes collection the products relationship column is empty which mean that any products still hadn’t linked to any size. So you can link the products to size and you should see the size in the preview!

Thank you

Thanks.

I have linked the 2 tables. But I don’t understand why the relationship column is empty.
The only parameters to fill are the tables to link and the typ of relation. But in my case, it is not enough to activate the link.

Are the matching columns defined automatically by adalo ?

Should records be added after adding the link ?

The relationship property is a property as other properties. You need to link it from the app by adding actions or you can link it in the database.

Check this video a bit from here : Create a News Mobile App using Adalo - YouTube

I use the option to link it in the database.
But the result is yet not valid.

image
image
image
image

You are using a many to many relationship? So a product can have many sizes and sizes can many products right? Now you can link them. So you can view the size collection and click on a record and you can add products in the products property you see when you click on a record in the collection. You can do the same thing viewing the products collection!

Then in the screen you can add a list and show current product>sizes. The reason you need a list because a product has many sizes and couldn’t show it on a single text component.

Yes. It works. Thanks.
But I have 250 products. And each product can have until 7 different sizes. Is there no way to link automatically each record together with a column index (column Refco is available into the 2 tables , in my case) ?

You mean to add to the relation property that matches the ID or without the relation property match with the ID in the preview?

I imagine when I add the relation property , I just precise the columns are matching.
After that, the records are linked automatically.

In this case, you need to precise not only the table to link but the columns too.