How to create a new thing from a search box?

This is a search box.

How to create a new thing with that “+” button?

Can I copy or save the value of the box to memory and paste … where?

2017-09-22_12h40_46

You can! A thing that’s a bit confusing about the search box (but makes sense when you learn about it), is that if it doesn’t return a result, the value is actually empty. In other words, a value must come from a record in the database.

So, to create a new record, use the SearchBox’s typed text instead.

image

2 Likes

Yes, it works this way:

1st - Check “Allow wntries not in the list”
2nd - For the “+” icon, create an action with this “…typed text”

But something is missing. Clicking again the “+” icon repeats the creation of the last entry.

How to prevent the icon “+” to create more, or forget it?

To reset the Typed Text after the record has been saved, place the searchbox in a group and use the Reset Data action on that group.

image

I made a quick example here: forum4 | Bubble Editor

1 Like

Thank you again @petter.

Following the guidelines, I do not get this result.
It also does not work on your app.
To observe, I took the liberty of changing your app just to show the list, so I was able to confirm.
If we click on the “+” icon, it does not forget …

1st - type a word and click “+”
2nd - now just click on the icon several times, the last one is repeated. Should forget , but no …

Hmm, yeah, ok, I see what you mean. If you click the icon without typing in a new name, it repeats the last one, even if the box is empty. I tried using the RESET INPUTS instead of RESET data, and that does not work either. I believe we have found another bug here.

Maybe Bubble resets the value of the SearchBox, but forgets about the typed text. Even the debugger says the typed text is not empty, even when it clearly is.

2 Likes

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