I have 4 tables that store details about users and events they attended along with evaluations. A trainer might have a couple thousand attendees and I can’t figure out how to do a search so they can search by ‘any field’ on the user table (typically name or email) and restrict it to only the events they are the trainer for.
Table:
Event Attendees
user (link to user)
event ( link to event)
evaluation (link to their evaluation)
User
user meta data (many fields)
events attended (list of events attendees)
I can easily get the list of event attendees for that trainer and show that full list. I currently have a dropdown to filter that by the event, whether there is an evaluation or not etc, but can’t figure out how to let them search for users.
I’m trying to do this:
search for users where anyfield contains the search value entered by the user
and where the user.events-attended list contains (search for events hosted by the trainer)
Ah… it’s a list field… you can’t compare two lists in Bubble in a search.
With your current database structure there’s no simple, or performant/scalable way to do this in Bubble… you’ll have to use an Advanced filter (which is done client-side, and therefore is not scalable).
But in any case, it shouldn’t be a search for Event Attendees, it should be a search for Events.
A better, more performant, and scalable (and more Bubble) way you could do this, would be to add a list of Users field to the User datatype to store the trainers of attended events.
Then you can simply search for Users who’s Attended Events Trainer field contains the current User.
cool, I may give that a whirl. I did try the reverse. I search the events attended where the user is in <search for users where any field contains user’s search input> AND where the event is in the list of events hosted by the current user.