# Dynamically get multiple inputs from user and store them locally

**URL:** <https://community.plotly.com/t/dynamically-get-multiple-inputs-from-user-and-store-them-locally/13208>\
**Category:** Dash Python\
**Created:** [August 31, 2018, 6:52pm UTC](https://community.plotly.com/t/dynamically-get-multiple-inputs-from-user-and-store-them-locally/13208 "2018-08-31T18:52:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pyre](https://avatars.discourse-cdn.com/v4/letter/p/35a633/32.png) [@pyre](https://community.plotly.com/u/pyre)\
**Post date:** [August 31, 2018, 6:52pm UTC](https://community.plotly.com/t/dynamically-get-multiple-inputs-from-user-and-store-them-locally/13208/1 "2018-08-31T18:52:22Z")

</div>

Hi,  
I have a dropdown and two input fields and a button. when user click the button they will be added to the dataframe for later use. now i had to define a global dataframe and each time user push the button i update that and show it as html table . but in this manner the app can not serve multiple users and the dataframe is available for all users. how can i get these data and store them ?

```
columns = ['name', 'class', 'odd', 'config']
df = pd.DataFrame(columns=columns)

@app.callback(
Output('_table', 'children'),
[Input('_add', 'n_clicks')],
[State('_name', 'value'),
 State('_config', 'value'),
 State('_dropdown', 'value')]
)
def _add_table(click, name, config, dropdown):
  
df_data = [_name , _dropdown, _config*2, _config]
df.loc[df.shape[0]+1] = df_data
            

    return html.Table(
        # Header
        [html.Tr([html.Th(col) for col in df.columns])] +

        # Body
        [html.Tr([
            html.Td(df.iloc[i][col]) for col in df.columns
        ]) for i in range(df.shape[0])]
    )
```

---

<div class="post-metadata">

**Author:** ![chriddyp](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/chriddyp/32/16855_2.png) [@chriddyp](https://community.plotly.com/u/chriddyp)\
**Post date:** [August 31, 2018, 8:44pm UTC](https://community.plotly.com/t/dynamically-get-multiple-inputs-from-user-and-store-them-locally/13208/2 "2018-08-31T20:44:07Z")

</div>

> [@pyre](#):
>
> now i had to define a global dataframe and each time user push the button i update that and show it as html table . but in this manner the app can not serve multiple users and the dataframe is available for all users. how can i get these data and store them ?

See [Part 4. Sharing Data Between Callbacks | Dash for Python Documentation | Plotly](https://dash.plot.ly/sharing-data-between-callbacks)

---

<div class="post-metadata">

**Author:** ![pyre](https://avatars.discourse-cdn.com/v4/letter/p/35a633/32.png) [@pyre](https://community.plotly.com/u/pyre)\
**Post date:** [September 1, 2018, 7:40am UTC](https://community.plotly.com/t/dynamically-get-multiple-inputs-from-user-and-store-them-locally/13208/3 "2018-09-01T07:40:17Z")

</div>

Thank you chriddyp for your quick reply. I looked at that tutorial but in my case i do not have pre loaded DataFrame, i just initialize it with known column names and update it each time user adds new data. I also considered using hidden Div but can’t figured out how to update that Div because each time it replaced. Do you have any suggestion how to handle this situation with hidden div or something to enable the app serve multiple users?  
many thanks.
