# How to remove dependent value from Dropdown?

**URL:** <https://community.plotly.com/t/how-to-remove-dependent-value-from-dropdown/50424>\
**Category:** Dash Python\
**Created:** [February 25, 2021, 8:03am UTC](https://community.plotly.com/t/how-to-remove-dependent-value-from-dropdown/50424 "2021-02-25T08:03:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gluperegistracije](https://avatars.discourse-cdn.com/v4/letter/g/e480ec/32.png) [@gluperegistracije](https://community.plotly.com/u/gluperegistracije)\
**Post date:** [February 25, 2021, 8:03am UTC](https://community.plotly.com/t/how-to-remove-dependent-value-from-dropdown/50424/1 "2021-02-25T08:03:04Z")

</div>

Hi,

I have two Dropdowns:

```auto
    dcc.Dropdown(
        id='departments',
        options=[{'label': f"{dep}", 'value': f"{dep}"} for dep in sorted(df.department.unique())],
        value=['dep01'],
        multi=True
    ),

```

```auto
    dcc.Dropdown(
        id='employees',
        # options=[{'label': emp, 'value': emp} for emp in sorted(df.employee.unique())],
        # value=['P01'],
        multi=True
    ),

```

and a call back:

```auto
@app.callback(
    Output('employees', 'options'),
    Input('departments', 'value'),
    Input('include_dep_employees', 'value'))
def set_cities_options(departments, include_dep_employees):
    if include_dep_employees == ['Y']:
        emps = sorted(df.query("department.isin(@departments)").employee.unique())
    else:
        emps = sorted(df.employee.unique())
    return [{'label': emp, 'value': emp} for emp in emps]

```

If I select a department, I see only employees from selected department, but…  
If I select two departments, and one employee from each department, and than remove one department, previously selected employee from removed department is still among values.

I would like to remove employee from employees dropdown if its department is removed.  
How to do that?

Regards.
