If 3 fields contain 1 value

Hi,

How we can use one (keyword search) value and say, if one of the three keywords (3 isolated fileds) contain the value, display this item (user)?

example2512512

Thanks! :slight_smile:

A few ideas that might work depending on what you’re doing.

  1. If you need the data in the UI, assign “Current cell’s algorithm’s word” to a custom state on some element in the context you need, and then reference that single custom state multiple times. (I never know with something like this if you can run into race conditions or not, so test it well)

  2. If you’re in a workflow (and it looks like maybe?) you can use the Reveal things to workflow Plugin | Bubble plugin to fetch a Thing once and then make it available down the line.

  3. Lastly, I’m sure this won’t sound like a fun change, but given the way bubble stores data and its queries work, would it be easier to store a keyword list in your user records? Then you could just do “keyword_list contains Current cell’s blah” etc.

A few options, I’m sure others will have more.
Good luck!

1 Like

Thanks @Steve_W!

You made three really good points! However, first is not suitable, as it’s about workflows, to display a list in a repeating group.

Second is good option, but trying to avoid plugins, not sustainable.

While for the third option have thought about, then I would need to change 3 each-users (keywords) field to a single list of keywords field. Quite big change, not sure, as those three keywords are really all over the place on the app, and it seems I like them to be separated, due to importance.

Is there an option where you can say either in the Search for Users, or :filter, if keyword1 matches (count as yes) or keyword2 matches (count as yes) or keyword3 matches (count as yes)?

Use a database trigger to concatenate your three keyword fields into one field for search.

Although not sure I understand why you can’t use three conditions connected with an Or.

1 Like

Thanks @NigelG! This seems interesting solution, the “trigger to concatenate”, can you share bit more about it?

Have just found another way, it works, although it’s bit slower search performace, so definitelly looking for a better solution here. Thanks!

example235515

Would “or” work better then “merge with”, and how to set it up, as here between “Search for Users” there is no “Or” option to choose. Thanks!

Ah, my mistake.

To do it with an Or, you need to add a filter after your search, then choose Advanced.

image

Not particularly performant.

Note you can also use “any field contains” ?

For the database trigger, in the Backend workflows, set up a database trigger.

image

So any time this fruit is updated, it will automatically re-create the list of combined tags by joining the two lists. Then you can use this to search.

I do this a quite a bit for setting up searches across.

2 Likes

Happy to give some interesting options.

I’m not sure your desire to avoid plugins will serve your development very well though. I haven’t seen other bubble devs remarking about them being particularly risky, and there’s a ton of stuff that is way easier with them than without them. The Thing Revealer is one of my favorites by far at this point.

1 Like

Thanks @Steve_W!

Have just counted 26 plugins in the one page app we have, and just yestered have done the app cleanup, and erased few plugins, trying to keep it low.

Have set up the solution with merging (If 3 fields contain 1 value - #5 by another), and it works very good, although would like to have some advancements.

Not sure about the plugin you shared and how it works (How distribute data to multiple actions in a server workflow - #2 by keith), now the word in my case is comming from a state.

Is there a way to see more about the plugin and how it works? Thanks!

Ah if your data is coming from a state that plugin won’t help too much, but also querying a state should be super fast. This plugin is more useful when you keep querying the same database Thing in multiple workflow steps so that you can just fetch it once.

1 Like

Thanks @Steve_W! Hope you agree Nigel got this thread solution, as more advanced solution provided. :slight_smile:

1 Like

Nigel’s answer is great, I learned a lot from it :slight_smile:

1 Like

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