Session State of multiple inputs text

Dear team,

I’m wondering of how to get the session state of multiple text input, which have unique key. I’m able to get the last text input only. How to access the key!

x= st.text_input(β€œx”, β€œ30”,key=β€œ1”)
y= st.text_input(β€œy”, β€œ60”,key=β€œ2”)
z= st.text_input(β€œz”, β€œ0.85”,key=β€œ3”)

No help :frowning:

Hi zuhoor

You can acces the session state from key like this:

st.session_state['1']
st.session_state['2']

If you dont use numbers as first character in your keys, you’re be able to access the session state like this:

x = st.text_input('x', '30', key='ti1')
st.session_state.ti1

Does this answer your question?