First use selectbox then multiselect data

I have a data frame and I need to select data from one column using selectbox() and then multi-select data from the dropdown list by using multiselect(), anybody knows how to set default value since multiselect() needs to set a default value.


First selectbox(columnB), then multiselect(columnC)


Hi @vivian,

First welcome back* to the Streamlit community! :tada: :partying_face: :star:

When creating a question we recommend you follow these guidelines to help you create a question that is more likely to get an answer:

So the st.multiselect does not need to have a default value, but st.selectbox does. Check out our docs on each of these to know how to pass all of the possible parameters to the widgets:

Selectbox docs

Multiselect docs

Here is a code example:

import streamlit as st

select = st.selectbox("A selectbox", ["A", 'B', "C"], 0)

multi = st.multiselect("A multiselect", ["A", 'B', "C"])

Happy Streamlit-ing!

1 Like