# Multiselect default value error

**URL:** <https://discuss.streamlit.io/t/multiselect-default-value-error/3247>\
**Category:** Using Streamlit\
**Tags:** multiselect\
**Created:** [June 4, 2020, 12:26am UTC](https://discuss.streamlit.io/t/multiselect-default-value-error/3247 "2020-06-04T00:26:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sehitkaradag](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@sehitkaradag](https://discuss.streamlit.io/u/sehitkaradag)\
**Post date:** [June 4, 2020, 12:26am UTC](https://discuss.streamlit.io/t/multiselect-default-value-error/3247/1 "2020-06-04T00:26:24Z")

</div>

Hi! I am new to using streamlit and I love it so far.  
But I am having issues with the multiselect. This is my code:

**defaultcols = [“Hotel\_Adress”, “Review\_Date”, “Average\_Score”, “Hotel\_Name”, “Reviewer Nationality”]**

**cols = st.multiselect(“Columns”, df.columns.tolist(), default= defaultcols)**  
**st.dataframe(df[cols].head(10))**

The error I get is:  
_StreamlitAPIException: Every Multiselect default value must exist in options_

I am using the newest version of streamlit-0.60.0 on my mac.  
Is there anyone who can help me in the right direction?

---

<div class="post-metadata">

**Author:** ![khalido](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/khalido/32/154_2.png) [@khalido](https://discuss.streamlit.io/u/khalido)\
**Post date:** [June 4, 2020, 3:50am UTC](https://discuss.streamlit.io/t/multiselect-default-value-error/3247/2 "2020-06-04T03:50:21Z")

</div>

Looks like some of the cols in `defaultcols` aren’t present in your dataframe - I’d double check that with something like

```python
assert set(defaultcols).issubset(df.columns)

```

The first list of columns you pass to St is the list of possible choices, and the second is the list of choices selected by default.

---

<div class="post-metadata">

**Author:** ![sehitkaradag](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@sehitkaradag](https://discuss.streamlit.io/u/sehitkaradag)\
**Post date:** [June 4, 2020, 9:27am UTC](https://discuss.streamlit.io/t/multiselect-default-value-error/3247/3 "2020-06-04T09:27:55Z")

</div>

Thank you for the quick reply! It indeed was the case that I missed some things. Thank you for time!

---

<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:26pm UTC](https://discuss.streamlit.io/t/multiselect-default-value-error/3247/4 "2021-11-19T17:26:41Z")

</div>


