# Error when using a single default value in multiselect

**URL:** <https://discuss.streamlit.io/t/error-when-using-a-single-default-value-in-multiselect/461>\
**Category:** Using Streamlit\
**Tags:** multiselect\
**Created:** [October 14, 2019, 8:03pm UTC](https://discuss.streamlit.io/t/error-when-using-a-single-default-value-in-multiselect/461 "2019-10-14T20:03:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![adi.kadrekar](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@adi.kadrekar](https://discuss.streamlit.io/u/adi.kadrekar)\
**Post date:** [October 14, 2019, 8:03pm UTC](https://discuss.streamlit.io/t/error-when-using-a-single-default-value-in-multiselect/461/1 "2019-10-14T20:03:12Z")

</div>

Hello,

When I execute the below command,  
options = st.multiselect(‘What are your favorite colors’, (‘Green’, ‘Yellow’, ‘Red’, ‘Blue’), (‘Yellow’, 'Red))  
st.write(options)

The above code works just fine.

But if I change the default to just a single value say ‘Yellow’  
It gives me an error saying every multiselect value must exist in options.

In my code, I am passing a list of values as options and giving the first element of the list as a default value but it is giving me the same error - ‘every multiselect value must exist in options’  
Why am I not able to do that?

Is there a workaround that?

---

<div class="post-metadata">

**Author:** ![Marc](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/marc/32/602_2.png) [@Marc](https://discuss.streamlit.io/u/Marc)\
**Post date:** [October 16, 2019, 5:31pm UTC](https://discuss.streamlit.io/t/error-when-using-a-single-default-value-in-multiselect/461/2 "2019-10-16T17:31:04Z")

</div>

the default single value should be a list for now

```auto
options = st.multiselect(
    "What are your favorite colors",
    ["Green", "Yellow", "Red", "Blue"],
    default=["Yellow"],
)

```

![image](https://global.discourse-cdn.com/streamlit/original/1X/a7c05c6d323b5733ea5c02775cb31ba606d2aa0a.png)

---

<div class="post-metadata">

**Author:** ![adi.kadrekar](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@adi.kadrekar](https://discuss.streamlit.io/u/adi.kadrekar)\
**Post date:** [October 17, 2019, 8:50pm UTC](https://discuss.streamlit.io/t/error-when-using-a-single-default-value-in-multiselect/461/3 "2019-10-17T20:50:38Z")

</div>

I understand now. Thanks for your help.

---

<div class="post-metadata">

**Author:** ![randyzwitch](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/randyzwitch/32/58772_2.png) [@randyzwitch](https://discuss.streamlit.io/u/randyzwitch)\
**Post date:** [November 19, 2021, 5:22pm UTC](https://discuss.streamlit.io/t/error-when-using-a-single-default-value-in-multiselect/461/4 "2021-11-19T17:22:30Z")

</div>


