# Dropdown update problem

**URL:** <https://community.plotly.com/t/dropdown-update-problem/22014>\
**Category:** Dash Python\
**Created:** [April 8, 2019, 9:57am UTC](https://community.plotly.com/t/dropdown-update-problem/22014 "2019-04-08T09:57:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasadovhal](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@prasadovhal](https://community.plotly.com/u/prasadovhal)\
**Post date:** [April 8, 2019, 9:57am UTC](https://community.plotly.com/t/dropdown-update-problem/22014/1 "2019-04-08T09:57:46Z")

</div>

I have created 2 dropdowns. both of them fires on single button. 4 days back this layout was working great.  
But since few days back only one callback is firing and not other one.  
I tried to look into the callback which was not firing. It turns out the callback firing but it is not returning anything.  
I tried to print everything till return of the same callback. everything prints well.  
Are there any changes has been made in core components?  
Please help with problem.

Code is as follow:

app.scripts.config.serve\_locally = True  
app.config[‘suppress\_callback\_exceptions’] = True

app.layout = html.Div([  
html.Button(‘get attributes’,id=‘get\_attributes’,n\_clicks=0),

```
    dcc.Dropdown(id="select_dep_var"),
    html.Div(id = 'store_dep_var'),
    dcc.Dropdown(id="drp1"),
    dcc.Dropdown(id="drp2"),        
    ])

```

@app.callback(Output(‘drp1’,‘options’),  
[Input(‘get\_attributes’,‘n\_clicks’),  
Input(‘select\_dep\_var’,‘children’)])  
def drp1update(n\_click,depend\_var):  
if n\_click \> 0:  
if depend\_var is not None:  
return [{‘label’: i, ‘value’: i} for i in data[depend\_var].unique()]

@app.callback(Output(‘drp2’,‘options’),  
[Input(‘get\_attributes’,‘n\_clicks’),  
Input(‘select\_dep\_var’,‘children’)])  
def drp2update(n\_click,depend\_var):  
if n\_click \> 0:  
if depend\_var is not None:  
return [{‘label’: i, ‘value’: i} for i in data[depend\_var].unique()]

@app.callback(Output(‘store\_dep\_var’,‘children’),  
[Input(‘select\_dep\_var’,‘value’)])  
def store\_dep\_var(dep\_var):  
return dep\_var

@app.callback(Output(‘select\_dep\_var’,‘options’),  
[Input(‘get\_attributes’,‘n\_clicks’)])  
def select\_dep\_var(click):  
if click \>0:  
print(‘returning attributes in dropdown’)  
print(click)  
print(data.columns)  
return [{‘label’: i, ‘value’: i} for i in data.columns]

if **name** == ‘ **main** ’:  
app.run\_server(debug=True)
