I’m working on Streamlit app using a select box to select one value, then click button which then I have retrieving data from API. Strangely enough, sometimes I select a value, and it doesn’t appear in the box, so I need to wait a few seconds and repeat again…and sometimes again for the value to register, and then it is actually picked up when I click the Submit button. Anyone else have this type of problem?
with st.sidebar.form("input_form"):
opp_id_name_list = tuple([""] + list(atm_df["opp_display"]))
opportunity_id_name = st.selectbox("Select Opportunity Id", opp_id_name_list)
try:
opportunityid = opportunity_id_name.split(" ")[0]
except Exception as e:
st.write(e)
opportunityid = ""
if "clicked" not in st.session_state:
st.session_state.clicked = False
submitted = st.form_submit_button(
"Get Opporturnity", on_click=submit_click_button
)
if submitted:
st.session_state.submit_inputs_click_button = True
st.session_state.chr_opportunityid = opportunityid
st.session_state.clicked = True