Forum Documentation Showcase Pricing Learn more

[New Feature] Breaking change - null search/filter parameters no longer dropped by default


#1

Hello everyone,

We’ve just introduced a breaking change to the default behavior of searches and filters. Historically, when you’ve done a search by a null value (for instance, “search for users” where "dog = "), the search constraint would be dropped and the search would return all users, regardless of the status of their “dog” field.

Following this change, the default behavior in this situation will to return only those users whose dog field is empty. This is useful if, for instance, you are explicitly searching for users without dogs. Note that the new behavior only applies to messages that make sense: you can search for “dog is equal to null”, but not “date is less than null”. The latter search constraint will be discarded as erroneous.

In cases where you’d prefer the legacy behavior, useful for instance in a situation where the user has left a search parameter blank, just check the “Ignore empty constraints” checkbox:

The same behavior applies to filters as well as searches.

We imagine some of you may now want to go through your app and look for places where you are performing searches whose behavior is affected by this change, for instance, all the places you you “do a search for” something, or define a constraint “dog is equal” to something. To this end, we recently added the ability to search the app by datasources and messages.

As with all breaking changes, the new default behavior is opt-in, available as an upgrade to version 5. You will be prompted to upgrade the next time you login, but you can also switch versions in the versions tab of settings.


1 Idea to improve Bubble: Add toggle for search filters so that when filter is null, either filter all values out or filter none out
Constraint: list-to-list
Best way to do a multi-option Search?
Data source with the "merged with" stopped working
Repeating group not showing data
#2

How about being able to drop the filter when using the ‘is in’ condition? Currently if the filter is blank the results are blank since it doesn’t get dropped


#3

This new “feature” broke my app. No longer shows all item if no filter is selected. Had to revert back to V4.


#4

Awesome!

This is a big deal for the bubble community. This change makes setting up searches/filters a lot more intuitive for new Bubblers while helping ensure the results that are returned from searches/filters match people’s desired behavior. This is particularly important in scenarios where users are searching for data to delete or displaying sensitive information because grabbing the wrong set of data in those scenarios can be very costly.

It also makes it a lot easier to construct the more sophisticated queries that a lot of production grade applications rely on and these simpler queries are likely to be more performant too.

Great work @Bubble!


#5

Going to have to spend some time finding every search for instance to check the ignore box. It seems, imho, that this box should be checked by default, so as to retain the previous functionality, and not break users’ apps.


#7

After update the app to version 5 my app showed some missing fields & data , so i backed to version 4 so i can retrieve the old data and to prevent any conflict !! please suggest ? do i need to fix every thing again after the update or is it OK to keep the app on the version 4 ?


#8

Second this… Turns out its very time consuming. Just had a app that is still early build and tired of finding all places to click that checkbox. The box should be checked by default when users upgrade to the new version. Else it will easily take over an hour for each fully built app


#9

Thirded! Cool feature, but would be great if that box could be checked by default before upgrading.


#10

BTW, Bubble folks: I believe there’s a internal developer warning/debug console message being generated that relates to this change. I’ve not seen this one before. It can be generated with (for example) a dynamic dropdown like this one:

When this dropdown first becomes visible in the page, a console message like the following is logged:

FYI…


#11

In one of my apps, I marked all the checkboxes in searches to avoid problems, but the most “impactful” feature was the dropdowns menus in which you have as an option an empty value. Until now, that option (empty) was showing in the UI (repeating groups, graphs, etc.) “all” options, and now it’s shown no options at all, so after marking all the checkboxes in the interface, it looks good now… For my other app, and now knowing what a mess it would mean, indeed it would be awesome to have that box checked by default! :slight_smile: In any case, for new people joining Bubble it will make sense. But for us, I’ll have to get used still!


#12

I hear this argument.

We do strongly urge you to put in the effort to go through your app and adjust to the new behavior. We implemented this not only because it made logical sense, but because we’ve encountered numerous cases of user apps that were performing badly or running out of capacity and discovered that filters temporarily accidentally getting dropped were leading to massive search results. Avoiding such situations will yield significantly better performance.

That said, we’re going to write a script that will allow you, on a one off basis, to automatically check all the relevant boxes to put functionality back the way it was. Thereafter you can opt in to the new behavior on a case-by-case basis. This will be coming along shortly; I’ll keep you posted.


#13

That’s awesome! Thanks for the info, @marca!


#14

When I have a privacy rule such as:
Current User’s AccountId = This item’s AccountId

I’m pretty sure previously it was returning all items when the Current User’s AccountId was blank.
So with this change, it should only return items with the blank AccountId?


#15

@eurogar @richardsonjj36 @gaurav @robert We’ve added a script that will automatically check all the “Ignore empty constraints” boxes throughout your app, thus restoring legacy functionality and allowing you to opt in to the new search behavior on a case-by-case basis. To run it, open the console and enter

restore_legacy_search_constraint_behavior()

We do strongly urge you to go through all the searches and filters in your app to adopt the new behavior, however. We’ve seen a number of cases of in which accidentally dropped null parameters have resulted in massive search results, impacting performance and needlessly using up capacity.


#16

Makes sense, thanks @marca


#17

Thanks, @marca!!!


#18

Awesome, was waiting for this. Makes it much easier to change all searches to the new situation. Thanks!


#19

Hi @marca

Not sure where to find that. Bubble editor is the console, right? I just updated it, but all my old ‘ignore empty constraints’ are still unchecked. What I’m missing? :slight_smile:

at the same time:


#20

In your browser’s developer console (F12 in most browsers). There you can do stuff like execute JavaScript functions, which is what this is.


#21

The developer tools console. In Chrome, view -> developer -> javascript console, or alt + cmd + j.