# How to programmatically trigger dashboard refresh from a plugin

**URL:** <https://discuss.elastic.co/t/how-to-programmatically-trigger-dashboard-refresh-from-a-plugin/347947>\
**Category:** Kibana\
**Tags:** dashboard\
**Created:** [November 24, 2023, 4:56pm UTC](https://discuss.elastic.co/t/how-to-programmatically-trigger-dashboard-refresh-from-a-plugin/347947 "2023-11-24T16:56:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sanskar\_Panchal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sanskar_panchal/32/127394_2.png) [@Sanskar\_Panchal](https://discuss.elastic.co/u/Sanskar_Panchal)\
**Post date:** [November 24, 2023, 4:56pm UTC](https://discuss.elastic.co/t/how-to-programmatically-trigger-dashboard-refresh-from-a-plugin/347947/1 "2023-11-24T16:56:02Z")

</div>

Hi,

I am building a plugin which adds a custom panel action for visualizations.  
I want to trigger dashboard refresh from with the code. I have access to data and dashboard plugin inside plugin , but I didn't find any function to trigger refresh manually.

Thank you.

---

<div class="post-metadata">

**Author:** ![Hannah\_Mudge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hannah_mudge/32/107993_2.png) [@Hannah\_Mudge](https://discuss.elastic.co/u/Hannah_Mudge)\
**Post date:** [December 1, 2023, 9:54pm UTC](https://discuss.elastic.co/t/how-to-programmatically-trigger-dashboard-refresh-from-a-plugin/347947/2 "2023-12-01T21:54:19Z")

</div>

@Sanskar_Panchal Hello!

From the `ActionContext` in your panel action, you should have access to the `embeddable` that triggered the action - if that embeddable is contained within a dashboard, its **parent** will be the Dashboard container! Once you have this, you should be able to call `reload` in order to refresh the dashboard. Putting this all together, you will get something like:

```auto
public async execute({ embeddable }: ActionContext) {
   const parent: DashboardContainer = embeddable.parent;
   parent.reload();
}

```

Hopefully that helps! 🙂 If you have any other questions, please don't hesitate to reach out.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 29, 2023, 9:54pm UTC](https://discuss.elastic.co/t/how-to-programmatically-trigger-dashboard-refresh-from-a-plugin/347947/3 "2023-12-29T21:54:39Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
