Displaying products based on category

Hello Gilders, I have created an app with products (table) and relating categories (table).

Now I want to create a custom screen with the categories and when I click on a category I want to show all the products who belong to that specific category.

How can I do this dynamically, so that I don’t have to create different screens for every category?

  • In your Categories table, create a multiple relation column that matches the Category name with the same value in your Products table
  • Create a screen/tab, and set the Categories table as the source
  • Click on one of the Categories to navigate to its Details screen
  • On that screen, add another Collection and set the multiple relation column as the source.
1 Like

I don’t know exactly what I’m doing…

I do have a ‘Category’ and a ‘Category Relation’ collumn in my Products table. Do I have to keep these collumns?

You don’t need the Category Relation column in the Products table. The important one you need is the relation in the Category table to link the category in that table to the category in the Product table.

2 Likes

It’s working now.

But I had to create a relating collumn from my Products table to my Categories table to populate the choice field when editing a Product or creating a new Product.

Is that the correct way?

You should be able to use your Categories table as the source of that Choice component.

1 Like

I will try that!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.