# Dash Table Update Values for columns with removing Rows

**URL:** https://community.plotly.com/t/dash-table-update-values-for-columns-with-removing-rows/71831
**Category:** Dash Python
**Created:** [January 22, 2023, 9:26am UTC](https://community.plotly.com/t/dash-table-update-values-for-columns-with-removing-rows/71831 "2023-01-22T09:26:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![vicky](https://avatars.discourse-cdn.com/v4/letter/v/b19c9b/32.png) [@vicky](https://community.plotly.com/u/vicky)
#### Post date: [January 22, 2023, 9:26am UTC](https://community.plotly.com/t/dash-table-update-values-for-columns-with-removing-rows/71831/1 "2023-01-22T09:26:48Z")

</div>

I am using the below code to update columns values and provision to add and delete rows. With row delete and add new callback values in columns are not updating. Can anyone help in this

```auto
from dash import Dash, dash_table, html
from dash.dependencies import Input, Output, State

app = Dash( __name__ )

app.layout = html.Div([
    dash_table.DataTable(
        id='computed-table',
        columns=[
            {'name': 'Input Data', 'id': 'input-data'},
            {'name': 'Input Squared', 'id': 'output-data'}
        ],
        data=[{'input-data': i} for i in range(5)],
        editable=True,
    ),
    html.Button('Add Row', id='editing-rows-button', n_clicks=0)
])

# Call back to calculate the output data
@app.callback(
    Output('computed-table', 'data'),
    Input('computed-table', 'data_timestamp'),
    State('computed-table', 'data'))
def update_columns(timestamp, rows):
    for row in rows:
        try:
            row['output-data'] = float(row['input-data']) ** 2
        except:
            row['output-data'] = 'NA'
    return rows

# Call back to add a new row

@app.callback(
    Output('computed-table', 'data'),
    Input('editing-rows-button', 'n_clicks'),
    State('computed-table', 'data'),
    State('computed-table', 'columns'))
def add_row(n_clicks, rows, columns):
    if n_clicks > 0:
        rows.append({c['id']: '' for c in columns})
    return rows

if __name__ == ' __main__':
    app.run_server(debug=False, port = 8094)

```

---

<div class="post-metadata">

### Author: ![AIMPED](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/aimped/32/21758_2.png) [@AIMPED](https://community.plotly.com/u/AIMPED)
#### Post date: [January 22, 2023, 9:51am UTC](https://community.plotly.com/t/dash-table-update-values-for-columns-with-removing-rows/71831/2 "2023-01-22T09:51:00Z")

</div>

Hi @vicky welcome to the forums.

You are trying to update the same property of a single component in two different callbacks which throws an error. You can’t see this error, because you’re ruining the app with `debug=False`

> [@Dash modal with separate button callbacks](https://community.plotly.com/t/dash-modal-with-separate-button-callbacks/71691/2):
>
> HI @Noone234 welcome to the forums. Reason for this is that you try to update the same component property from different callbacks. You have two options: combine the two callbacks into one callback and use callback [context (ctx)](https://dash.plotly.com/advanced-callbacks#determining-which-input-has-fired-with-dash.callback_context) use the multiplexerTransform from [dash-extensions](https://www.dash-extensions.com/transforms/multiplexer_transform) For your application I would recommend the first approach.
