[New Feature] Now supporting "in" operator for unique ids

Hey everyone!
We added a new feature where you can now use the “in” or “not in” operator for searches constrained by unique ids. This means that you can now filter for unique ids that you specify in a list while doing a search, either via the data API or in the editor as a search constraint.

Previously with the data API, we did not allow for getting multiple things at once via their unique ids, since it would cause a timeout. We have now made this query much faster and more efficient, so that users can have more flexibility in the types of search queries they create. Allowing the “in” operator now means that users can quickly retrieve multiple things at once given their unique ids, or retrieve all things except for those unique ids specified.

You can specify the constraints in this format:
[{"key": "_id", "constraint_type": "in", "value": [list of unique ids]}]

On the editor, users will have this same type of flexibility, but instead will also be able to create dynamic lists of unique ids directly in the search constraint field:

Screen Shot 2022-12-08 at 1.10.09 PM copy

As always, we welcome any feedback or questions you may have!

Happy Bubbling!

57 Likes

Wow this is a major power user feature add! :slight_smile: Kudos!! This is going to skinny up a lot of my heavy database calls and simplify some of my workflows. Excellent Bubble – Thank you!

4 Likes

So is this like a Bubble December Advent Calendar?

Cuz if so, I’m going to be pissed off we have to wait until December 2023 for new features lol…

Yay new feature!

7 Likes

Great news! It would be amazing to also see „contains list“ constraints in list fields soon.

1 Like

How did I miss this! :+1:t2::+1:t2::+1:t2:

1 Like

Great !!!

Sorry, but I think there is some inconsistency in your example, as it was the second query, it refers to the unique id field which naturally would never be duplicated! How would it be to choose another field to define the uniqueness of the items?

@sravani any change we can do list in list searches on a server side soon?

Hey @sravani

It seems that applying the “unique id is in” condition, if applied multiple times in the same search does not return any result, even if the unique id is present in all conditions. I would expect that the result would be an intersection of all ranges instead in this case.

What I mean:

Do a Search for a Thing, where

  1. unique id is in Range X
  2. unique id is in Range Y

Even if a unique id is present in Range X and Range Y, the result will be empty.

Am I the only one having this issue? Is the search behaving as expected and my expectation is wrong?

Thanks for your help on this.

fyi everyone reading this: Bubble support confirmed that this was a bug which has now been fixed.

2 Likes

Hi,

I am using this, what I am doing is creating some data things > and then saving the unique IDs in a custom state, which is a List of Texts.

There after I am Doing a Search for Items - where Unique ID “is in” the Custom State , it doesnt give the output.

I am trying to read this list in a Repeating Group and have some auto-binding input elements in the repeating group, so I need to modify the data of those specific data things.

Any help here would be good.

@sravani

Actions are not necessarily done in sequential order, are you creating your list of things, hoping that it creates them before your search happens?

Hey @sravani , there’s been a tiny bug since this feature was released, where if you pick unique id as the constraint it auto picks = and skips right to what data source you want.

So it’s a little confusing since you have to reselect = and pick “is in” or “is not in”, etc. Normally I feel this behavior is kept for when there’s only one operator choice?