Need help with an expression

Hey everyone :wave:

I’ve been working on this way too long and need some help.

The “Search applicant’s name” input is set to Text, and the RG below it is set to “Conversations” which is a list of users. Obviously, when someone enters a name in search, I want the RG to show that person.

With Conversations being a list of users and a user’s name being a text, which matches the data type of the Search input, how can I write an expression that the RG will understand?

Thank you!

You can use “contains” or “contains keyword” operators for text fields matching with input element. Check the difference and limits in Bubble manual.

Appreciate the response.

See the constraint that uses contains in the screenshot? It’s locked onto a user type. It won’t lock onto a text type e.g., "conversation-users contains “user” “users name (text type)”, unfortunately. In addition, there isn’t an option to select “contains keywords”, only “contains”.

Let me ask if I’m going about this the right way…

I’m trying to tie the RG to the input search As you see, there are already two constraints on the RG to facilitate normal operations and behaviors.

What I envision is adding a third constraint specific to the search input. The ignore empty constraints checkbox will apply to that in the RG constraint window.

Is adding a third constraint for the search the right place to put this expression that’s puzzling?

In closing, two questions 1) the right expression and 2) the proper place to write it.

Thanks again

Just confirming, is the searchbox at the top an actual search box or just an input?

With a searchbox you need to add a new constraint with conversion-users contains searchboxe's value.

If it’s text, then you need to do a nested search (not the fastest in a large app). Add a new constraint conversation-users contains Do a search for Users where the name (the field with the first and last combined) contains keyword(s) Input Search's value.

The best way though in a large app would be to create a search index field on conversions data type that includes keywords like the name.

1 Like

Good stuff, Justin. Thanks.

The search is an input, and your nested search suggestion worked albeit with about a 3 second delay in results. Not optimal!

Appreciate your suggestion about adding a search index field. It’s the best approach.


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