🏥 🏭 Working on the COVID-19 response in Canada? Plotly & the Canadian government can help you and your organization. Learn more and get in touch.

Datatable 'Add Row' button only ever appends one row to datatable

Hi everyone,
I’ve a datatable that implements the ‘add row’ button using the code below:

if n_clicks_1 > 0:
    data.append({c['id']: 0 for c in columns})

However, if i press the button again it doesn’t append another row to the table. In fact, if i had entered some values into the row i first added, click the ‘add row’ button erases evrything.

Where am i getting this wrong?