-1

I've written the following code which is working fine.
Is there a way of saving the user input to a csv which can be downloaded that will update every time a new entry is made every day? Do I need to upload a blank csv file?

Thanks

import streamlit as st

with st.form('Feedback_Form'):
    st.header('Feedback Form')

    col1, col2 = st.columns(2)
    with col1:
        name = st.text_input('Enter product name')
        How_Many = st.slider('Please Select Quantity',0,10,5)
    with col2:
        Date = st.date_input('Enter Date')
        Time = st.radio('Select time to nearest label time', ('7.30', '7.45', '8.00', '8.10', '8.15'))

    submit_button = st.form_submit_button('Submit')

if st.form_submit_button:
    st.write('**Enter product name:**', name, '**Enter Date:**', Date,
             '**How Many:**', How_Many, '**Time:**', Time)
liambh
  • 9
  • 2

1 Answers1

0

I'd recommend setting up the inputs as a form, and then adding a function that gets called when the submit button is clicked to update the CSV file. In terms of actually writing data to the CSV file, there are a ton of threads on this:

Caroline Frasca
  • 511
  • 2
  • 10