I have tried running this both locally and deployed and I am having problems after clicking the submit button that the changes are persisting in the data editor. What i would like is for it to revert to the “empty” dataframe.
[Gumby] It sounds like you’re encountering a common issue with Streamlit’s data persistence.
Define a *get_empty_df()* function to create our initial “empty” DataFrame.
use Streamlit’s *session_state* to manage the DataFrame’s state across reruns.
After submission, we reset *st.session_state.df* to a new empty DataFrame.
We call st.rerun() to refresh the app with the reset DataFrame.
This approach ensures that after each submission, the data editor reverts to its initial state. The st.rerun() call is crucial as it triggers a complete refresh of the app, ensuring the UI reflects the reset state