Copy data from field in current record to another field

sorry if this is a dumb noobe question, but I am trying to setup a search function, and with the fuzzy search plugin, ( and maybe bubble search too?) I can only search text fields, but need to search a number field. wouldn’t it be possible in the next step in the workflow after a order id number field is created, to copy that number to a text field so I can use it in searches? seems weird that number fields are not searchable, but what do I know, lol.

Hi there, @help5… as you have already seen, you can’t search a number field, but you can do what you (and the linked post) said and store a textual representation of the number so you can use that field in the search.

Best…
Mike

thanks for commenting, but I don’t see any way to copy the number field to a text field. seems like a simple task, but I am not finding it. I thought there would be a way to keep the number field, and copy to a new text version to a text field so that it is searchable.

In the workflow, have a step that simply sets the text field equal to the number field (assuming the number field has been populated in a previous step), and you should be good to go.

first step of creating an order, creates an order id number field, and that works great. I have created another field called order id searchable and set it as text, but nothing I can think of works. start the next step with make changes to a thing?

Yes, have a step that makes changes to the result of step 1 (i.e., the order creation step), and the change to make should be order id searchable = order id.

1 Like

I always get stuck when it’s not all in the same field. first select the thing to change, and then change another field is where the magic happens. :grin:

I really appreciate your patience!

1 Like

You can do it right in the Create action by setting your text field to the exact same expression as the number field. So if you’re searching for something and doing ID + 1 or whatever just copy paste that expression

1 Like

in which step? in step 1 when I submit order, it looks up the last order and adds 1 then in step 2 I do the above. it is working super, but are you saying there a simpler or better way?

Yep I’m saying in the step 1 set your “Package ID Searchable” to the same expression (copy and paste the blue expression you’ve made already)

you’re right that works too and eliminates the extra step in the workflow. it is all a bit convoluted to my thinking, because I absolutely need the number field to do the auto increment function of my package id, but then can just use the text version of that field everywhere else in the front end, right?

Yes it’s more a of a flaw of the Fuzzy Search plugin where you can’t search a number field, normally with a Bubble search constraint you can just reference the number like you would expect…

On your front end you can pretty much reference either one.

wait, I thought that bubble doesn’t allow searching numbers either, not just the plugin. I assumed the plugin constraint came from bubble, not a flaw in the plugin.

Take another look at the post I linked to in my initial reply… that’s why you can’t search a number field the same way you would search for text, fuzzy search plugin or not.

2 Likes

that is what I understood :slightly_smiling_face: you guys are awesome, thanks again!

It’s a little weird, my input in this screenshot is set for Text so I have to override it with :converted to a number. If your input is Integer or Decimal it will let you directly search it. But if you are trying to search multiple fields at once this won’t work so you would need to get fancy with it and merge searches together, the first one matching the Order ID, and the other search being everything else… or just do what you did already and store the orderID as text.

It’s not really a search like “contains” it’s more like “does this input literally match this field” in my screenshot

Also the Fuzzy Search plugin is a client side search so if your database starts to get large there would be performance issues. Maybe you do want a separate Order ID input box to find exact matches instantly…

the way it is now, my order id’s started with 12345, next is 12346, etc. i can start typing 1234… and it narrows the results as I type which is perfect for my needs, unless, as you say it gets clunky as the db grows. I can imagine that lots of things that work great with a small number of records, starts breaking as it grows, but for now, I’m super happy.

The fuzzy search is really nice, but it’s client-side meaning if you have 1,000,00 packages in your system it downloads the entire list, then sorts through which ones match your search which will absolutely slow down because of the huge list to download.

Using vanilla Bubble search constraints uses their server-side searching magic which instantly returns the list of values and delivers that to the client. The problem is it’s trash at recognizing slight misspellings (which the Fuzzy search is good at handling).

If you are only searching for Order ID and don’t care about other fields
do a plain old Do a search for Package with a constraint Order id searchable contains Input's value it would give you the same result, where you type 1234 and it shows you 12341,12342, etc. even with 1,000,000 items in your database

But that’s only the case for if you are searching for that one “Order ID searchable” field. If you do “any field contains” it has a mind of it’s own and will not show you those order IDs. If you are searching a bunch of field stick with the Fuzzy Search and see what happens :joy:

Either way keep your text field storing the ID.

1 Like

Also if you find any weird delays in typing and it not actually starting the search, check out the 1T - Input Watcher plugin, it returns the immediate value from the input instead of the slight delay Bubble has

The Fuzzy Search plugin has this built in but if you are doing the vanilla search you can use that