# Remove all items from ControlP5 dropdownlist

**URL:** https://discourse.processing.org/t/remove-all-items-from-controlp5-dropdownlist/36060
**Category:** Libraries
**Created:** [April 1, 2022, 7:35am UTC](https://discourse.processing.org/t/remove-all-items-from-controlp5-dropdownlist/36060 "2022-04-01T07:35:32Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ybr](https://avatars.discourse-cdn.com/v4/letter/y/df788c/32.png) [@ybr](https://discourse.processing.org/u/ybr)
#### Post date: [April 1, 2022, 7:35am UTC](https://discourse.processing.org/t/remove-all-items-from-controlp5-dropdownlist/36060/1 "2022-04-01T07:35:32Z")

</div>

Hi,

I’m filling a controlp5 dropddownlist with columns from a CSV file.

```auto
 for (int i=0; i<columns.length; i++) {
    time.addItem(columns[i], i);
}

```

But when I load a different file, the controlp5 dropdownlist should show the columns of that file. How do I remove all items from the dropdownlist so that I can add the items from the new file to an empty list?

Thanks

---

<div class="post-metadata">

### Author: ![ybr](https://avatars.discourse-cdn.com/v4/letter/y/df788c/32.png) [@ybr](https://discourse.processing.org/u/ybr)
#### Post date: [April 1, 2022, 8:22pm UTC](https://discourse.processing.org/t/remove-all-items-from-controlp5-dropdownlist/36060/2 "2022-04-01T20:22:33Z")

</div>

That was actually really easy.

```auto
time.clear();

```

did it for me!
