Imagine that my visitors can type in any word into an Input Field on my webpage.
When they hit enter, I want bubble to take the “Input’s value” (the word the visitor typed in), and combine that word with a list of words that I already have stored in my database - in the field called “word”.
I want the results displayed on the webpage, and not stored in the database.
I’m guessing I need to setup a new State?
And use a “Repeating Group” beneath the “Input Field” and “Generate Words” button?
I’m also guessing that I would have to create a workflow connected to the button. But should I choose “Data > Make changes to a thing” or “Element Actions > Set State”?
I’m really stuck here, so any help would be highly appreciated.
Make a repeating group on the page. Set content type to Text. Set datasource to the data entry you have the field ‘word’ then do merge with and reference the inputs value followed by the :converted to list.
If for some reason bubble doesn’t expose the :converted to list after the reference to the inputs value, then you can instead after the merged with operator use the ‘arbitrary text’ and the value would be the inputs value then use the :converted to list operator.
Hi Boston,
Thank you so much for helping me out. I really appreciate it.
I’m still facing several issues, though.
Most of the time it’s something like “Set State: Value should be List of texts but right now it is a empty”.
Here is what I have so far:
Data Type
Data Type: “valuekeys”
Data Field with words: “word”
Set State:
Set State created: “combined-state”
Type: text
List: Yes
And I have these elements on the same page (“generate page”) and in the same group (“Group A”) in the following order:
Input Field (“user-input-field”).
Content format: Text
Button (“generate-button”)
Workflow: I’ve simply given up on the workflow
Repeating Group (“list-of-combined-words”)
Type of content: text
Data Type: Search for valuekeys merged with user-input-field’s value
Btw: No matter what I’ve tried I’ve haven’t been able to get bubble to show the “:converted to list” option.
The above setup comes with two issues:
-
“list-of-combined-words: Data source should be a list of texts but right now it is a empty”
-
“Set State: Value should be a List of texts but right now it is a empty”
Do you have any idea as to what’s wrong and what has to be changed?
P.S. I’ve double checked my data type (valuekeys > words > “list of words”), and it seems like there is no issues with the data. Under the field “word” is a long list of words and the content is set to “text”.
Looks like Bubble is not exposing converted to list…I think this is because they fail to recognize the benefit of exposing this for more than just data types or option sets and the generic data types like text or number should also have those exposed.
In that case, put together the custom state list, make it type text. On page load, run a set state action to set the custom state to the value set you have from the database. Then setup a workflow trigger for ‘when inputs value is changed’ and run the action to set the custom state, the value should be the custom states value plus item this inputs value. Then the RG can reference the custom state list.
Are you going to allow users to use the same input to add multiple values, or is it that you want them to just add a single value from the input. So for example, will a user be able to add a value like apple, then clear the input and add another value like orange? Or is it that they can just add apple, and if they cleared the input and then entered orange, that the value of apple should be removed from the list?
I see you are a beginner , learn how to use regex with the help of chat gpt that way you will be able to fully manipulate text