Black Lives Matter. Please consider donating to Black Girls Code today.

Dynamically get multiple inputs from user and store them locally

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])]
    )

See https://dash.plot.ly/sharing-data-between-callbacks

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.