I’m looking for a way to determine when a selectbox is used. After that and only after that i want other functions to take action.
I have been using the key option for a reset button but if used to run or not run the filter as below this would always run the filter upon refresh because of the default value being “Any”. But what i need is that the filter function only runs when a change within the selectbox is made.
I hope i could make it somewhat clear what i’m trying to achieve.
pulls a dataframe which uses index as parameter
Index = st.sidebar.selectbox(‘Index:’,[‘Any’,‘A’, ‘B’,‘C’],key=‘Index’)
st.session_state.Index = ‘Any’
st.sidebar.button(‘Reset Filters’, on_click=reset)
#I want to achieve is something like:
run filter function
dont run filter function