# Ad Hoc Trends - Delete Public Chart

**URL:** <https://forum.inductiveautomation.com/t/ad-hoc-trends-delete-public-chart/86415>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [February 27, 2024, 8:54am UTC](https://forum.inductiveautomation.com/t/ad-hoc-trends-delete-public-chart/86415 "2024-02-27T08:54:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jayden](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@Jayden](https://forum.inductiveautomation.com/u/Jayden)\
**Post date:** [February 27, 2024, 8:54am UTC](https://forum.inductiveautomation.com/t/ad-hoc-trends-delete-public-chart/86415/1 "2024-02-27T08:54:18Z")

</div>

Hi Everyone,

Looking for an example where someone has added a button to call a delete query to remove a saved a public chart in the AdHoc trends template. I’m assuming I’m not missing another way to go about this?

Thanks

---

<div class="post-metadata">

**Author:** ![Arnaud\_Declerck](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/arnaud_declerck/32/44872_2.png) [@Arnaud\_Declerck](https://forum.inductiveautomation.com/u/Arnaud_Declerck)\
**Post date:** [February 27, 2024, 9:40am UTC](https://forum.inductiveautomation.com/t/ad-hoc-trends-delete-public-chart/86415/2 "2024-02-27T09:40:12Z")

</div>

Hi @Jayden

```auto
	if dbType == 'POSTGRES':
		return '''
		DELETE 
		FROM 
			ad_hoc_trends_config
		WHERE 
			id = ?'''

```

This is the query i use for postgres where id is de id of your trend

Regards

---

<div class="post-metadata">

**Author:** ![Jayden](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@Jayden](https://forum.inductiveautomation.com/u/Jayden)\
**Post date:** [February 27, 2024, 7:43pm UTC](https://forum.inductiveautomation.com/t/ad-hoc-trends-delete-public-chart/86415/3 "2024-02-27T19:43:43Z")

</div>

Thanks Amaud,

Much appreciated
