I think I have a very simple question that I cannot figure out the solution and hope someone in the forum can help.
I have a repeating group displaying data from the Products data type, and I want to create a dropdown that filters the products on the repeating group that the availability = No, empty images and price < 5.
The custom state is of type “product” … so it is expecting a “product”. You are trying to give it a “y/n” value … or an options set with a “no” display. It simply does not work because you have to give it what it expects.
Now … to filter your rg for products with a “y/n” value of “no” … set up your search constraint like this > “availability” = rg’s custom state’s product’s availability is no (or … the option set “no”). This assumes that the availability field is of type “y/n” or of type options set with one of its option being “no”.
Your thought process is incorrect. A repeating group element is searching and filtering for a list of entries of an object’s fields/attributes. It is assessing row by row each object entry against constraints and advanced rules. That is it.
I do not know how you structured your dB but let’s assume that a product has a field called “availability” of type “options set” also named “availability”. And let’s assume that this options set has three options > #1 “no”, #2 “empty images”, and #3 “price < 5”.
Then … the search would be … search products where the constraint would be availability = custom state of type options set “no” … or however else you can provide this options set option to this constraint.
I see that you are doing lots of filtering and likely are managing for some things to work and for some others not. You should take a second look at your dB model and also watch a few videos on searching/filtering lists. Lists can be of any kind … but they are lists at the end of the day … and they are managed differently than single entitites (… think … singular vs plural).
I think it’s not possible filtering the repeating group by some constrains, because my availability data field is type yes/no and I need to create a new data field and set as an option set to make it work.
However, I found a workaround that is not perfect but does the job using multiple repeating groups and adding different constrains in each one.
Also, I watched the videos that you send and was amazing