Need help with the right search for a repeating group

I have users in my app that are connecting with each other similar to Tinder or Linked which creates a category called Match (or Connection)

The ‘Initiated User’ clicks the meet button on the user which changes the match status to ‘PENDING’
The ‘Matched User’ will clicked the meet button as well which creates the connection and changes the status to ‘ACCEPTED’

Pretty simple to search for their PENDING users in a repeating group.

But difficult to search for all connected users because a user could be the initiator or the matched user.

Please let me know what else I can share to get advice on this.

Hopefully I’m understanding correctly. This will probably need some adjustments, but you could create a new data type called “matches” with three fields: initiator, potential match, accepted match.

When the button is clicked, make change to Matches (also select the “create new thing when no match is found”). Fields to set are initiator = current user; potential match = the other user. Then when the other user accepts, make another change to the Matches record – populate the “accepted match” field with the current user.

Thank you for your guidance on this. I have the following categories:

Conversations
Messages
Match
- Status - [Text Field] Pending, Accepted, Rejected
- Initiated User (initiated the connection)
- Matched User (accepts the connection)
Users

I have a group page called “Matched List” which is a list of all user connection with the status = accepted in which they were either the Initiated User or the Matched User. But for that respective user it should only show a list of who they are connected with. From their they should be able to click on the users name and a pop-up box will display more information or the envelope icon to go right into their conversation.

Right now changing the content type I’m able to pull in the correct users in the Matched List but not display the right information for the conversation.

Happy to share my backend with you via inbox

You may need two repeating groups: One to show matches that the user initiated and one to show where someone selected them.

For the first table, make the search in the repeating group where the Initiated User = Current User, then you can use a text element to show the name of the Matched User and the status.

For the second table, make the search where the Matched User = Current User, then you can use a text element to show the name of the Initiated User and the status.

I was thinking that as an option as well. My issue is it will be an extra step or clunky for the user. Would like them to click one link “MY MATCHES” the see the full list.

Here is what I did to make one repeating group but accounting for both Match User Types: Initiated and Matched.

Did a Search for all users with the following Conditionals:

When: Search for Matches: count > 0
Status = accepted
Matched User = Current User
Data Source: Search for Matches Initiated User
Status = accepted
.Matched User = Current User

When: Search for Matches: count > 0
Status = accepted
Initiated User = Current User
Data Source: Search for Matches Matched User
Status = accepted
Initiated User = Current User

This gives me the correct connected user in my My Matches repeating group

In that group a user has the ability to do 2 things both leading to directly messaging their connected user:

  1. Click their name and a popup appears to see more detailed info on the user and message them
  2. Click on the envelope icon to instantly inbox them.

Everything works as expected accept allowing the user to join the existing message thread as expected.

I don’t have bubble in front of me right now but I believe you can merge two lists, so I’m thinking you could have a content type of user then a data source that is a merge of two searches. The first could be do a search for matches where (constraint) status is accepted and current user is the initiator - and the returned field is matched user’s user. The second is the reverse. Merge the two lists and then do unique records.

I don’t know what impact this sort of double search plus merge might have on performance, though. You may want to consider a different data structure.

I have solved for the first half of my issue by switching the data type to user and doing a conditional search for Iniated User and Matched user.

Shows up perfectly.

Now my issue is taking both users into the right message thread. Think I’m missing a field in the user category that connects to conversations.

Ah, I missed your previous post. So in your RG you end up with a list of Users, right? If so, then when you click on a cell can you not run a workflow that searches for conversations including both the current user and the current cell’s user? Or is it the case that two users can be matched more than once and each match between them has a different conversation thread? If this is the case then I see how it could be tricky to find the right thread.

So there are two ways in the app to get to a message thread

1 - is direct from a user profile
2 - using the list of conversations page, click on any conversation to reveal a message thread.

The challenge I’m having is for a list of my matches: ones that I initiated or ones that have initiated me it’s difficult to go from that user directly into the message thread.

In order for me to pull in both Initiated and Matched Users I had to switch the content over to User and it works fine.

But going from the user content and into conversation content is where I’m having issues. Feels like I’m missing a conversation field in the user category

Could be … but if Conversation has a Users field, that could/should be enough. I think what you may need to do is a search within a search, perhaps?

SearchInSearch

Edit: I’ve tried to recreate your scenario here (as far as I’ve understood it anyway). I hope it helps.

Great news! I figured it out by doing a conditional search by Initiated and Matched to account for when the current user plays both roles.

Thanks for your help and guiding me

1 Like