Toggle repeating group by list of text options

Hi, I’m trying to allow a user to be able to sort data in a repeating group by the Type of a list of text field (types include Daily, Weekly etc).

For example: the user can press a button “Daily” and only lenses that have “Daily” in their list of texts for “Type” field name show up.

from this to :

My database is structured like this:

Hi @vassili.zinchenko

  1. Create a custom state in your page called “filter”;

  2. In the conditional tab of your repeating group create a condition to change data source when your custom state “filter” is not empty. And include the custom state value as a parameter to constraint your search. Just copy the original search, paste it in the conditional tab and add the custom state “filter” as a constraint parameter.

  3. Create a workflow for each text. When your user clicks the “Daily” text, change the value of your custom state “filter” to “Daily”.

Make sense?

Thank you for the reply!
I got step 1 done however on step 2.: I don’t see the state “filter” as an option for RepeatingGroup.
If I create a custom state on the RepeatingGroup, “daily is visible” (as a text) I don’t get very far with being able to write a condition to select for Type: Daily (which is a list of texts, and contains Daily, Weeky, Monthly etc)

Sorry if I’m missing something but can you not just filter by storing the selected text option in a custom state (called _searchText for example) and then have the Data Source on the RG be “Search By Lenss” with a constraint of “Type Contains _searchText”. In the Search tick the Ignore Empty Constaints box.

Where did you have created your custom field?
If it was in the home, you need to type home’s filter and not Daily.
The constraint should be “Type contains home’s filter”

Thank you for the suggestions, I managed to get it to work 2 ways. One without a custom state, and one with. Not sure which way is better? Both seem to work fine to a point.
If I use the custom state option, I need to reload the page to be able to choose another type of lens after the initial choice. For example, if user clicks Daily button, all Daily lenses are listed fine, but as soon as they click Monthly, the list is blank until reload. This is not an issue when using option 1 (non-state).

Non option-state verision:

Option state version:

edit:

I had to create a second option state to link to the first, and now the user can choose any lens option they like without refreshing the page.

Still not sure why I needed to do that. This video helped a lot for the process: https://www.youtube.com/watch?v=6Fykdt81Xmg&ab_channel=NoCodeable