# Programatically list component ids in current layout

**URL:** <https://community.plotly.com/t/programatically-list-component-ids-in-current-layout/27665>\
**Category:** Dash Python\
**Created:** [August 23, 2019, 2:15am UTC](https://community.plotly.com/t/programatically-list-component-ids-in-current-layout/27665 "2019-08-23T02:15:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafaelc](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@rafaelc](https://community.plotly.com/u/rafaelc)\
**Post date:** [August 23, 2019, 2:15am UTC](https://community.plotly.com/t/programatically-list-component-ids-in-current-layout/27665/1 "2019-08-23T02:15:59Z")

</div>

Is there a way to list (within a callback) all the currently available ids in the app layout? For example if my app has three divs and all have ids getting a list with the three values.

---

<div class="post-metadata">

**Author:** ![kmouratidis](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/kmouratidis/32/6706_2.png) [@kmouratidis](https://community.plotly.com/u/kmouratidis)\
**Post date:** [August 23, 2019, 4:10pm UTC](https://community.plotly.com/t/programatically-list-component-ids-in-current-layout/27665/2 "2019-08-23T16:10:03Z")

</div>

A very simple way to do this is wrap everything you need in a div, and give it an id: `html.Div(id="stuff")`. Then just put it into whatever callback you want as state: `State("stuff", "children")`. The result will look something like this (here, a `dcc.Dropdown` within an `html.Td`):

![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/6/6acf9a8b33c5b79f5d2666c0b76dc22f02f3657e.png)

And then you can access whatever you want, e.g.: `div["props"]["children"]["props"]["value"]`.

There are other ways to do this, but I’m not too sure since it’s been some time. I think it was something along these lines (one or more of them, all are worth looking into), on the app object (`app = dash.Dash`):

- `app.callback_map`
- `app.layout`
- `app._layout`
- `app. __dict__ `

---

<div class="post-metadata">

**Author:** ![rafaelc](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@rafaelc](https://community.plotly.com/u/rafaelc)\
**Post date:** [August 23, 2019, 5:12pm UTC](https://community.plotly.com/t/programatically-list-component-ids-in-current-layout/27665/3 "2019-08-23T17:12:23Z")

</div>

Thanks! This is exactly what I needed.
