Sort / Filter Repeating Group by Repeating Group Data

Hoping someone can point me in the right direction, please see screenshot below

I have an input and button I’m saving the text input into a data type field called filter name which is displayed in the first RG (Hershey, M&Ms and Kitkat).

How would I go about sorting the 2nd RG based on what’s in the first RG?
For example Susan has Hershey and M&Ms in her list of Snaps so she would appear in the list when the first 2 filters are added but once KitKat is added she would no longer be in the list.

Populating the first RG is done.
I tired populating the 2nd RG by Doing Search For with :filters, etc… but nothing seems to work, any suggestions I could try?

1 Like

Are you hoping to click on the filters in the first repeating group and then only show users who have that filter in their candy-list?

Hi @williamtisdale
The end user types in the text for filter they are searching for then after clicking the button it goes into the first repeating group and I wanted to somehow sort the second repeating group based on that list of items.

I don’t know if this is possible?

If they were clicking in the first RG I could probably do Display data from that group to the other repeating group (kind of like a popup), so maybe I can also do this in the button workflow after the button is clicked (be back soon)…

Edit: I guess that’s not an option(I couldn’t get access to the 2nd RG this way, I even tried creating a custom state to possibly pass the information that way without much luck). back to the drawing board :slight_smile:

I think I understand. So in your original example in the image you would not want Susan to show because she does not have kitkat? If so, this is possible and I wouldn’t mind building an example but I just want to be clear on the objective.

Hi @williamtisdale,

Thats correct (she would show up after Hershey and M&Ms are entered but once Kikat is entered she would no longer be on the list). That would be amazing of you to take the time to build an example and greatly appreciated! Thank you so much, its awesome of you to share your knowledge (I’ll do the same as I learn more).

@williamtisdale was absolutely amazing in figuring this out and Id like to try and recap what was done in case others are trying something similar.

Part 1:
The setup is now like this:

Custom states on the page (page name index):
SearchFilterState: text, list checked
SnapState: Snaps, list checked

Using the custom page states is how we are going to populate the RG Searches
The RG Searches Type of content: text, Data source: Index’s SearchFilterState:sorted with Descending “no”

We need to create a Workflow for the SnapState to be populated on page load in the workflows tab Click to add an event (empty square), General, Page is loaded
Step 1: Then Element Actions, Set State, Element: Index, Custom state: SnapState, Value: Search for Snapss

After inputting a value here is the Button Workflow:
Step 1: Set state, Element: index, Custom state: SearchFilterState, Value: Index’s SearchFilterState: plus item Input for Search filter’s value. Step 2: Reset relevant values

Inside of this RG Searches we need to add a text element to be able to see what whats inside: Text Appearance: Current cell’s text:capitalized words. We are setup so you can now add an item to the RG Searches from inputting a value and clicking the button.

Stay tuned for Part 2 etc… be back shortly

1 Like