I team, I have an app that has two functions, the strong textfirst function is to display the menu option, and once the user inputs the details to log in to the database, then the second function appears displaying the table selection. However, when the user selects the table from the drop-down. The table selection option is disappearing
def menu(): with st.form(key="my_form"): global username username = st.text_input("Username:") global password password = st.text_input("Password:") global db_Host db_Host = st.text_input("Database Host:") global db_Name db_Name = st.text_input("Database Name:") global db_port db_Port = st.text_input("Database Port:") global submit global conn conn=None submit = st.form_submit_button("Connect") def table_selection: if submit: . . . option = st.selectbox('Select table name', df,index=0,key='option')
If applicable, please provide the steps we should take to reproduce the error or specified behavior.
Once the table is selected from the drop-down, the option should show the new table selection
Explain what you expect to happen when you run the code above.
once the user is selecting the table from the drop-down menu, the drop-down menu is disappearing. I don’t know how to add session state to my code
- Streamlit version: (get it with
$ streamlit version)
- Python version: (get it with
$ python --version)
- Using Conda? PipEnv? PyEnv? Pex?
- OS version:
- Browser version:
Using Conda? PipEnv? PyEnv? Pex? Share the contents of your requirements file here.
Not sure what a requirements file is? Check out this doc and add a requirements file to your app.
- Link to your GitHub repo:
- Link to your deployed app:
If needed, add any other context about the problem here.