Trying to optimize a filter setup using a 1T Dropdown
I’m setting up a filter for a repeating group — pretty straightforward. Our database has separate fields for each social media handle (e.g., TikTok, Instagram, YouTube, etc.), which makes sense for how our app works.
I’d like to use a single 1T Dropdown where clients can choose which socials they want users to have. I got it working using conditionals, but it ended up being like 30 separate conditions
I thought I could simplify it with an advanced :filtered search like:
“If 1T dropdown contains X, then user’s X field must not be empty”
But even with “ignore empty constraints” checked, I can’t get it to return the right results when multiple fields are selected.
Anyone figured out a clean, performant way to do this?
The clean, performant way to do this is to NOT have separate fielsd for each social media handle - but have a separate datatype of social media links. Then it’s simple, easy to manage, performant, and scalable.
I’m not sure there is any way to do this having separate field on the User datatype for each social handle (without an absurd number of conditional datasources and merged searches) as you can’t conditionally use ‘is empty’/’isn’t empty’ in a search.
In the vast majority of cases you can usually avoid the need for conditional searches with the clever use of variables.
But I think this is one of the rare cases where conditional datasources are unavoidable (although I’d suggest, not at all practical here - even with just 3 social media fields you’d have to have 7 conditional searches, I’m I’m guessing you’ve got more that 3 social media fields).
(maybe I’m overlooking something obvious - but I’ve faced this issue before, and I don’t think there’s a workaround).
What is the need to have these all as separate fields - rather than a separate datatype?
We’re approaching 10k users for the search, so my thinking was that using what I believe is called a “satellite search” on data types would be quicker for the end user. I’m more comfortable in JavaScript, so I didn’t realize I’d be hitting a limitation in Bubble when it comes to building filters this way.
That’s why I originally kept separate fields for each social handle — I thought it would make the search structure faster to query — but I now see the practical downsides you’re pointing out with the conditional searches. So you’re suggesting I make a separate “Social Media” data type — in that case, what’s the most efficient way to filter them from a single filter input?