# Two identical values in custom state

**URL:** <https://forum.bubble.io/t/two-identical-values-in-custom-state/276931>\
**Category:** Need help\
**Created:** [August 9, 2023, 5:23am UTC](https://forum.bubble.io/t/two-identical-values-in-custom-state/276931 "2023-08-09T05:23:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![zelftb](https://avatars.discourse-cdn.com/v4/letter/z/a88e4f/32.png) [@zelftb](https://forum.bubble.io/u/zelftb)\
**Post date:** [August 9, 2023, 5:23am UTC](https://forum.bubble.io/t/two-identical-values-in-custom-state/276931/1 "2023-08-09T05:23:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![boston85719](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/boston85719/32/77286_2.png) [@boston85719](https://forum.bubble.io/u/boston85719)\
**Post date:** [August 9, 2023, 5:58am UTC](https://forum.bubble.io/t/two-identical-values-in-custom-state/276931/2 "2023-08-09T05:58:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![amer](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/amer/32/160811_2.png) [@amer](https://forum.bubble.io/u/amer)\
**Post date:** [August 9, 2023, 6:28am UTC](https://forum.bubble.io/t/two-identical-values-in-custom-state/276931/3 "2023-08-09T06:28:28Z")

</div>

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 .

---

<div class="post-metadata">

**Author:** ![ihsanzainal84](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ihsanzainal84/32/245932_2.png) [@ihsanzainal84](https://forum.bubble.io/u/ihsanzainal84)\
**Post date:** [August 9, 2023, 7:19am UTC](https://forum.bubble.io/t/two-identical-values-in-custom-state/276931/4 "2023-08-09T07:19:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zelftb](https://avatars.discourse-cdn.com/v4/letter/z/a88e4f/32.png) [@zelftb](https://forum.bubble.io/u/zelftb)\
**Post date:** [August 9, 2023, 6:08pm UTC](https://forum.bubble.io/t/two-identical-values-in-custom-state/276931/5 "2023-08-09T18:08:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![amer](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/amer/32/160811_2.png) [@amer](https://forum.bubble.io/u/amer)\
**Post date:** [August 9, 2023, 7:15pm UTC](https://forum.bubble.io/t/two-identical-values-in-custom-state/276931/6 "2023-08-09T19:15:42Z")

</div>

`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

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/a/e/ae7b6fa53621df7f9c6aefc062ee03ce07c36660.png)

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

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/0/9/0952b3e6e801b88b42c1d5e68bda1cc9f08073b8.png)

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/3/8/388bda4edd12498d3647f0b841391c7c9ed911e4.png)  
Preview : [tutorial\_bubble](https://tutorialbubble-80950.bubbleapps.io/version-test/duplicate_values)  
**Hint :**  
`split` keyword is used to split a string into a list of strings

---

<div class="post-metadata">

**Author:** ![zelftb](https://avatars.discourse-cdn.com/v4/letter/z/a88e4f/32.png) [@zelftb](https://forum.bubble.io/u/zelftb)\
**Post date:** [August 9, 2023, 7:27pm UTC](https://forum.bubble.io/t/two-identical-values-in-custom-state/276931/7 "2023-08-09T19:27:06Z")

</div>

Thanks man!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [October 18, 2023, 5:23am UTC](https://forum.bubble.io/t/two-identical-values-in-custom-state/276931/8 "2023-10-18T05:23:32Z")

</div>

Closed on October 18, 2023, 5:23am UTC

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