# Retrieve Active Labels of Checkbox Group?

**URL:** <https://discourse.bokeh.org/t/retrieve-active-labels-of-checkbox-group/2849>\
**Category:** Community Support\
**Created:** [March 19, 2018, 1:05am UTC](https://discourse.bokeh.org/t/retrieve-active-labels-of-checkbox-group/2849 "2018-03-19T01:05:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wjk68](https://discourse.bokeh.org/letter_avatar_proxy/v4/letter/w/6de8d8/32.png) [@wjk68](https://discourse.bokeh.org/u/wjk68)\
**Post date:** [March 19, 2018, 1:05am UTC](https://discourse.bokeh.org/t/retrieve-active-labels-of-checkbox-group/2849/1 "2018-03-19T01:05:30Z")

</div>

The CheckboxGroup allows access to the active indices and all the labels through attributes but does not have an attribute for the \*\*active labels. \*\*

checkbox = CheckboxGroup(labels = [‘foo’, ‘bar’, ‘baz’], active = [0])

print(checkbox.active)

print(checkbox.labels)

``

```auto
[0]
['foo', 'bar', 'baz']

```

``

\*\*\*\*I think it would be useful if it were possible to access the labels themselves that are selected in addition to just the indices.

Currently, I do the following to get the active labels:

active\_labels = [checkbox.labels[i] for i in checkbox.active]  
print(active\_labels)

``

```auto
['foo']

```

``

Is there an easier method to get the active labels that I am missing?

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads.bokeh.org/original/2X/1/14eb24f9e10e4e9b78e3f10f66c04ffa96446e5a.svg) [@system](https://discourse.bokeh.org/u/system)\
**Post date:** [July 21, 2021, 9:14pm UTC](https://discourse.bokeh.org/t/retrieve-active-labels-of-checkbox-group/2849/2 "2021-07-21T21:14:27Z")

</div>


