Multiple filter widgets

I am new to streamlit and extremely happy to be part of such a vibrant community.
My question is that i have 3-4 selectbox widgets and i am filtering values through these widget. I want to update these widget in such a way that if one widget value is selected the rest of the widgets option should get updated according to that filter. Does streamlit provide any such functionality.
Any assistance regarding it should be much appreciated. Thanks

1 Like

Hi @Hassan_waseem, and welcome to the Streamlit forum! :raised_hands:

This would works yes, via nested conditionals โ†’ https://kodify.net/python/if-else/nested-if/

A simple example would be:

if slider_01 == 1:
    st.selectbox('Select', [1,2,3])
else:
    st.selectbox('Select', [3,4,5])

Note that this wouldnโ€™t apply to widgets nested in an st.form widget (Batch Input Widgets | Introducing Submit Button & Forms)

I hope that makes sense and please let us know how it goes! :slight_smile:

Happy Streamlitinโ€™! :balloon:

Thanks
Charly