# Checklist example doesn't work Dash 2.0

**URL:** https://community.plotly.com/t/checklist-example-doesnt-work-dash-2-0/61776
**Category:** Dash Python
**Created:** [March 9, 2022, 4:09pm UTC](https://community.plotly.com/t/checklist-example-doesnt-work-dash-2-0/61776 "2022-03-09T16:09:25Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![shane](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@shane](https://community.plotly.com/u/shane)
#### Post date: [March 9, 2022, 4:09pm UTC](https://community.plotly.com/t/checklist-example-doesnt-work-dash-2-0/61776/1 "2022-03-09T16:09:25Z")

</div>

I’m trying to use examples from the documentation but the examples no longer work without extensive component definition. In [checklist documentation](https://dash.plotly.com/dash-core-components/checklist) this is given as the first exapmle:

```python
dcc.Checklist(['New York City', 'Montreal', 'San Francisco'], 'Montreal')

```

But results in

```auto
Exception has occurred: TypeError
`id` prop must be a string or dict, not ['New York City', 'Montreal', 'San Francisco']

```

Even if I define the component attributes:

```auto
checklist1 = dcc.Checklist(id="checklist1", options=['New York City', 'Montreal', 'San Francisco'], value='Montreal')

```

I don’t see the options listed in my app:  
 ![Screenshot from 2022-03-09 08-06-07](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/e/a/eaa8b2ff9b980eb307a02c49368f085067cdf8a3.png)

However, this code works fine:

```python
checklist1 = dcc.Checklist(
   options=[
       {'label': 'New York City', 'value': 'New York City'},
       {'label': 'Montreal', 'value': 'Montreal'},
       {'label': 'San Francisco', 'value': 'San Francisco'},
   ],
   value='Montreal'
)

```

So to use a valid checklist requires manually defining the **label** and **value** of each entry which is tedious and harder when I’m trying to teach beginners.

Any suggestions? I filed a [bug report](https://github.com/plotly/dash/issues/1960)

---

<div class="post-metadata">

### Author: ![AnnMarieW](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@AnnMarieW](https://community.plotly.com/u/AnnMarieW)
#### Post date: [March 9, 2022, 5:22pm UTC](https://community.plotly.com/t/checklist-example-doesnt-work-dash-2-0/61776/2 "2022-03-09T17:22:15Z")

</div>

Hie @shane,

The shorter syntax such as:

```auto
dcc.Checklist(['New York City', 'Montreal', 'San Francisco'], ['Montreal'])

```

is available starting in dash V2.1.0, so upgrading the latest version should fix that error.

I noticed something odd though. When debug mode is off, this works.

```auto
dcc.Checklist(['New York City', 'Montreal', 'San Francisco'], 'Montreal')

```

But when debug mode is on, you need to put `["Montreal"]` in a list. (I think that might be a bug)

---

<div class="post-metadata">

### Author: ![adamschroeder](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/adamschroeder/32/17280_2.png) [@adamschroeder](https://community.plotly.com/u/adamschroeder)
#### Post date: [March 9, 2022, 6:34pm UTC](https://community.plotly.com/t/checklist-example-doesnt-work-dash-2-0/61776/3 "2022-03-09T18:34:01Z")

</div>

Thank you @AnnMarieW and @shane for reporting this bug. The short syntax has been fixed, and like Ann said, it is available with Dash v2.1 or higher. Regarding the debug off mode allowing value as string instead of list, that should not be the case, so it’s definitely a bug. I reported this to our technical writers so we can fix it.

---

<div class="post-metadata">

### Author: ![shane](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@shane](https://community.plotly.com/u/shane)
#### Post date: [March 10, 2022, 12:42am UTC](https://community.plotly.com/t/checklist-example-doesnt-work-dash-2-0/61776/4 "2022-03-10T00:42:35Z")

</div>

It works! Thanks for answering so quickly @AnnMarieW!
