Hi, i am trying to display different pages for my app depending on inputs in my session_state.
Page 1: gather group name
Page 2: Once group name has been entered, display a text field for input. After pressing submit, display the text to user.
Here’s a simplified code:
import streamlit as st
if "group" not in st.session_state:
st.text_input("Group Name:", key="group")
elif st.session_state.group:
st.header(st.session_state.group)
feedback = st.text_input("enter feedback")
submitted = st.button("submit")
if submitted:
st.write(feedback)
When user input group name in page 1, the app correctly moves to page 2. However when user key in their feedback in page 2 and press enter/submit, the feedback is not displayed. Instead, it returns to page 1 and the group name disappears. How do i get the feedback to display and the group name to persist even after pressing the submit button?
Thank you.