Repeating Group Displays Records When It Should Be Empty

I suspect I’m encountering a Bubble quirk here and I’m willing to accept it as such, but I can’t quite figure out a workaround.

So I have the following data structure (simplified for the example)

  • User (email, name etc)

  • Group (date created etc)

  • GroupMember (user[User], group[Group])

In other words, a GroupMember is a User and belongs to a Group.

Now I have a RG that should display all members of a group that a selected user (in a dropdown) belongs to. This works fine when the selected user does in fact belong to a group. The issue occurs when the selected user does not belong to any group. The RG still displays group members for the first group in the database (in my example I have just one group in the database anyway) when it should be empty.

It seems that Bubble has an issue with null search results and I suspect this is the issue I’ve hit, but I’m not sure how to get around it in my specific case. Any ideas, please?

App Editor and Screenshot below:

App Editor: https://bubble.io/page?type=page&name=searchbug&id=louisforum&tab=tabs-1

Screenshot:

Okay, I found a way. I added a condition to hide the RG if the group is empty. Seems like a poor workaround to me, though. If anyone has a better idea, I’d appreciate it.

Yeah, that’s the type of workaround that I’d use. Additionally, you could set it to conditionally use a different data source, such that it’s not showing the first group in your database, but instead shows another specified list. It really depends on what you want to display when the user doesn’t belong to a group.

1 Like

I’ve hit the same issue and used a workaround by adding an additional constraint in my searches to explicitly exclude the null condition. So in your case, Do a search for–>GroupMember with 2 constraints on the group field:
group = current cell’s group
group is not empty

3 Likes

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