Filter data Products by category

Good morning friend, I would like you to help me with the following:

I have two tables, one called category and the other products.

I have two Repeating groups listing each one, in the products group I have a type of data called category where I store which categories each product belongs to, for example, one two categories: others and technology, and one product, for example: lamp, that product I save those two categories in the categories field.

Sorry if the explanation is long, but the help I need is if when you click on the product in the list of categories, show only the ones it belongs to and hide the others.

Thanks for your help, have a nice day

How are the relations between Product and Category determined? Product data type has a list Category field or Category data type has a list Product field?

1 Like

I used those tables as an example, but I’ll be more specific. I have these tables, Companies and Departments.

In the departments table there is a field called company, which saves a list to which the department belongs, here is an image with an example

image

What I would like to do is that when I click on a department it shows me the list of the companies to which it belongs

image

I’m trying those repeating groups, I can’t find how to do it

  1. create a custom state XYZ to store chosen Department (type = Department)
  2. In the RG where you’d like to show relative Companies add in data source XXX's Companies
1 Like

Can we be more specific please?

  1. Create custom state “SelectedDepartment” of type “Department”
  2. Add a WF that will be triggered when user clicks on something in the cell of Departments RG. Action set state, value = current cell's Department.
  3. in Companies RG add data source SelectedDepartment's Companies
1 Like

Works!! But one extra question and I hope it’s not too much of a hassle, but can it be done so that if the custom state action has not yet been executed, it shows the complete list of departments when starting the application?

Still THANK YOU VERY MUCH FOR THE HELP!!

Sure:

  1. for default data source use ordinary Do a search for Companies
  2. for conditional data source (conditional tab) check if SelectedDepartment custom state is empty. If not - change data source to SelectedDepartment's Companies
1 Like

Thank you so much!! I had already been stuck on that for days, REALLY THANK YOU VERY MUCH!!!

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.