Two identical values in custom state

Hey! I don’t understand if I can set two (or more) identical values in custom state list?
I have custom state for a group. it’s a list of text. When I do some action I’m adding a new state to a list. It depends on action so sometimes I do the same action and I need to add the same text in a custom state I already have. But It’s not adding.

I think Bubble does not allow for multiple of the same value in a list.

2 Likes

Yes if you state that had list of texts and use plus item you must add new item .
You can use state type text and when you to add new item you can append it (allow duplication) and append dot(.)
when you show it in RG you can split text with dot (.) it will be list of texts .

2 Likes

Yep Bubble does not allow duplicate items to be added to a list. You’ll need to use plugins or as suggested by @amer, format your list as a single string, pick a delimiter than split that text into a string using the :split by operator.

2 Likes

I’m not familiar with append function yet. How the sentence will look like?

append : keyword is used to add text to the end of a string. For example, if you have a string variable called text that contains the text “Hello world!”, you can use the following code to append the text “Bubble” to the end of it:
Result will be : “Hello world! Bubble”

Suppose you have state called list (type is text and not list of values ) to append a new one you do like following

in RG you will split text by (. as a delimiter) to list of strings


Preview : tutorial_bubble
Hint :
split keyword is used to split a string into a list of strings

Thanks man!

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