# Avoiding using Global Variables

**URL:** <https://community.plotly.com/t/avoiding-using-global-variables/13235>\
**Category:** Dash Python\
**Created:** [September 3, 2018, 7:50am UTC](https://community.plotly.com/t/avoiding-using-global-variables/13235 "2018-09-03T07:50:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![OliverBrace](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/oliverbrace/32/4039_2.png) [@OliverBrace](https://community.plotly.com/u/OliverBrace)\
**Post date:** [September 3, 2018, 7:50am UTC](https://community.plotly.com/t/avoiding-using-global-variables/13235/1 "2018-09-03T07:50:36Z")

</div>

I wish to use a variable within the sheet to run a call back i.e.:

```
@app.callback(
    Output('Holder', 'children'),
    [Input(Generate_ID([UPDATED_VALUE]), 'value')])

```

however I am trying to avoid doing this with a global variable for reason as explained in [https://dash.plot.ly/sharing-data-between-callbacks](https://dash.plot.ly/sharing-data-between-callbacks).

However since the value is already within a callback trying to run a callback on a callback using a hidden variable results in dependency errors (and using app.layout[’…’].value has an issue as described in [Values in input not updating](https://community.plotly.com/t/values-in-input-not-updating/13201)).

Would “User-Based Session Data on the Server” be a recommend way of doing this (as described in [https://dash.plot.ly/sharing-data-between-callbacks](https://dash.plot.ly/sharing-data-between-callbacks))

Many Thanks
