# Popup fired by dashboard button

**URL:** <https://forums.losant.com/t/popup-fired-by-dashboard-button/1805>\
**Category:** Help\
**Tags:** experience\
**Created:** [May 20, 2019, 2:33pm UTC](https://forums.losant.com/t/popup-fired-by-dashboard-button/1805 "2019-05-20T14:33:09Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![nahuel](https://avatars.discourse-cdn.com/v4/letter/n/8dc957/32.png) [@nahuel](https://forums.losant.com/u/nahuel)\
**Post date:** [May 20, 2019, 2:33pm UTC](https://forums.losant.com/t/popup-fired-by-dashboard-button/1805/1 "2019-05-20T14:33:09Z")

</div>

Hi there!

Is there a way of firing a popup on the client side after a dashboard button is pressed?  
I used Firefox inspector to get `button Id` and then tried adding the following code to the layout that holds the dashboard but had no luck.  
 ![imagen](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/c/c7850d2a6e055d553b45d24b81533c46f1cf9aaa.png)

---

<div class="post-metadata">

**Author:** ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)\
**Post date:** [May 20, 2019, 3:34pm UTC](https://forums.losant.com/t/popup-fired-by-dashboard-button/1805/2 "2019-05-20T15:34:30Z")

</div>

Hi @nahuel,

Currently, this is not possible. I think the best route here would be too simply add an HTML [button](https://www.w3schools.com/tags/tag_button.asp) to the page, and attach a listener to that.

Best of all, if you need that button to trigger a workflow, there is an API that you can use to [Press a Virtual Button](https://docs.losant.com/rest-api/flow/#press-virtual-button).

Happy to answer any more questions if needed 🙂

---

<div class="post-metadata">

**Author:** ![Leo\_Bach1](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@Leo\_Bach1](https://forums.losant.com/u/Leo_Bach1)\
**Post date:** [May 20, 2019, 3:59pm UTC](https://forums.losant.com/t/popup-fired-by-dashboard-button/1805/3 "2019-05-20T15:59:03Z")

</div>

If you have time, could you create an example of this? I too am struggling to notify my users on dashboard pages of certain events that result from running workflows.  
The walkthrough ([https://docs.losant.com/experiences/walkthrough/views/user-profile/](https://docs.losant.com/experiences/walkthrough/views/user-profile/)) helped with custom page notifications using the successAlert and the errorAlert components but it seems that this cannot be used for the dashboard pages in the same way.

---

<div class="post-metadata">

**Author:** ![nahuel](https://avatars.discourse-cdn.com/v4/letter/n/8dc957/32.png) [@nahuel](https://forums.losant.com/u/nahuel)\
**Post date:** [May 20, 2019, 4:14pm UTC](https://forums.losant.com/t/popup-fired-by-dashboard-button/1805/4 "2019-05-20T16:14:29Z")

</div>

Thanks. I’ll go with the HTML button

---

<div class="post-metadata">

**Author:** ![Leo\_Bach1](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@Leo\_Bach1](https://forums.losant.com/u/Leo_Bach1)\
**Post date:** [May 21, 2019, 4:06pm UTC](https://forums.losant.com/t/popup-fired-by-dashboard-button/1805/5 "2019-05-21T16:06:56Z")

</div>

How are you able to add additional HTML elements alongside your dashboards?

---

<div class="post-metadata">

**Author:** ![nahuel](https://avatars.discourse-cdn.com/v4/letter/n/8dc957/32.png) [@nahuel](https://forums.losant.com/u/nahuel)\
**Post date:** [May 21, 2019, 6:08pm UTC](https://forums.losant.com/t/popup-fired-by-dashboard-button/1805/6 "2019-05-21T18:08:47Z")

</div>

Hi @Leo_Bach1. I recommend you reading [page-layout](https://docs.losant.com/experiences/walkthrough/views/page-layout/) document, it helped me while understanding the platform. You’ll find that either if a page is `custom` or `dashboard` type they are rendered inside the layout using the page helper, `{{ page }}`.  
The layout is built using HTML and Handlebars helpers. So, if you modify the HTML code you’ll be able to add new elements.

---

<div class="post-metadata">

**Author:** ![Leo\_Bach1](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@Leo\_Bach1](https://forums.losant.com/u/Leo_Bach1)\
**Post date:** [May 21, 2019, 6:21pm UTC](https://forums.losant.com/t/popup-fired-by-dashboard-button/1805/7 "2019-05-21T18:21:58Z")

</div>

Thanks for the direction! Much appreciated!

---

<div class="post-metadata">

**Author:** ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)\
**Post date:** [May 21, 2019, 7:54pm UTC](https://forums.losant.com/t/popup-fired-by-dashboard-button/1805/8 "2019-05-21T19:54:06Z")

</div>

@nahuel and @Leo_Bach1

I just documented a new helper for you. It’s called the {{element}} helper.

> **[Experience Views](https://docs.losant.com/experiences/views/#element-helpers)**
>
> Learn more about creating and using experience views in the Losant platform.

You can use it to embed a dashboard directly on a page like this:

```auto
{{element 'dashboard' dashboardId='5c1c2acf98e7400007443f56' theme="light" }}

```

Right now, `dashboard` is the only element supported 🙂 But, this should help build more flexible pages with dashboards.

---

<div class="post-metadata">

**Author:** ![Leo\_Bach1](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@Leo\_Bach1](https://forums.losant.com/u/Leo_Bach1)\
**Post date:** [May 22, 2019, 8:41pm UTC](https://forums.losant.com/t/popup-fired-by-dashboard-button/1805/9 "2019-05-22T20:41:30Z")

</div>

I tried to change my Gateways Page to a Custom Page from a Dashboard.

I included the element helper for the dashboard that I wanted to pull up in the custom html input area.

```auto
{{element 'dashboard' dashboardId='5c829292979b130008e5d604' theme="light" }}

```

Clicked “Save”.

And tried to access the page from my user experience (which still seems to be active and working):

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/1/10a49ea4d121bba1a952a8701d9139ec2f53a073.png)

From the edit page I attempt to open Gateways:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/f/f601d7690dbdf9dc9aa884d9bde6fe0567d03d96.png)

And this is the result I get now (I cannot get back to the area where I can edit the custom HTML or select custom/dashboard):

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/c/cd5ed7e7a55f9fee27aee2d233481d68de581769.png)

Can someone help me get back to where I can edit the page?

Sorry for the headache. Thanks for the support!

---

<div class="post-metadata">

**Author:** ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)\
**Post date:** [May 22, 2019, 8:44pm UTC](https://forums.losant.com/t/popup-fired-by-dashboard-button/1805/10 "2019-05-22T20:44:07Z")

</div>

Hey @Leo_Bach1,

Our team is looking into this now 🙂

---

<div class="post-metadata">

**Author:** ![Leo\_Bach1](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@Leo\_Bach1](https://forums.losant.com/u/Leo_Bach1)\
**Post date:** [May 22, 2019, 8:45pm UTC](https://forums.losant.com/t/popup-fired-by-dashboard-button/1805/11 "2019-05-22T20:45:57Z")

</div>

Thanks! I am trying to avoid breaking things as much as I can.

---

<div class="post-metadata">

**Author:** ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)\
**Post date:** [May 22, 2019, 9:21pm UTC](https://forums.losant.com/t/popup-fired-by-dashboard-button/1805/12 "2019-05-22T21:21:55Z")

</div>

@Leo_Bach1,

Looks like you found a bug on our end and we have already pushed out a fix live for you 🙂

P.S. Keep breaking things, we want to make sure the platform is the best.

---

<div class="post-metadata">

**Author:** ![Leo\_Bach1](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@Leo\_Bach1](https://forums.losant.com/u/Leo_Bach1)\
**Post date:** [May 22, 2019, 9:48pm UTC](https://forums.losant.com/t/popup-fired-by-dashboard-button/1805/13 "2019-05-22T21:48:04Z")

</div>

Getting Closer:  
I’m trying to pass the context in to the dashboard as I was doing before:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/2/20dba34a7275b377819fa552a9c54eb2f93cbd5b.png)

Here is the dashboard context in question:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/1/1d9b1358bad5d9a69eb0d236a73cf396cd7cc983.png)

Here is where I call the context within the Device List Block:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/9/9dc9fdc7d66a0b35d370496c431222f6b23a23a8.png)

Here is the error I get when visiting using my experience user login and visit the page:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/0/00ac116ec277ce2e6f32e0e9155b915796980bc0.png)

Any direction would be appreciated.

Thanks!

---

<div class="post-metadata">

**Author:** ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)\
**Post date:** [May 22, 2019, 10:16pm UTC](https://forums.losant.com/t/popup-fired-by-dashboard-button/1805/14 "2019-05-22T22:16:19Z")

</div>

Since the deviceTag context variable is a little weird, for that one, you have to specify a key and a value.

LIke so:

```auto
{{element 'dashboard' dashboardId="ID" ctx=(obj companyName=(obj key="companyName" value="testCompany" ) )}}

```

I’ll update this in the docs 🙂

---

<div class="post-metadata">

**Author:** ![Leo\_Bach1](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@Leo\_Bach1](https://forums.losant.com/u/Leo_Bach1)\
**Post date:** [May 23, 2019, 2:05pm UTC](https://forums.losant.com/t/popup-fired-by-dashboard-button/1805/15 "2019-05-23T14:05:28Z")

</div>

Taron,  
It looks like I broke it again…  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/4/49b98643dc5fb1469b6f90c5fe6362047f8fe261.png)

I accidentally put handlebars around the pageData object when inputting the value:

```auto
{{element 'dashboard' dashboardId="ID" ctx=(obj companyName=(obj key="companyName" value="{{pageData.experience.user.userTags.companyName}}" ) )}}

```

---

<div class="post-metadata">

**Author:** ![Leo\_Bach1](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@Leo\_Bach1](https://forums.losant.com/u/Leo_Bach1)\
**Post date:** [May 23, 2019, 2:51pm UTC](https://forums.losant.com/t/popup-fired-by-dashboard-button/1805/16 "2019-05-23T14:51:47Z")

</div>

Current settings for the Gateways Page (using element helper for the dashboard and the context):

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/9/93ec02e9c69cb58bff8ead5a7da00285da517506.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/0/08e1be7dcfd313a109f70045d7e0002ca978aa7b.png)

Using the context within the Device List Block on the dashboard itself:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/c/cde55803c2c68baa560d4228cd53758d5451dd28.png)

A Device that should meet these parameters and therefore show up on the Device List Block:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/8/84b2e7427f08314758b09c9b540f8aaa7029c3b0.png)

The Experience User that is visiting the Gateway Page:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/c/cd7df1d8c1588fb7f1e39c8bcde42d794e000b65.png)

No device shows up on the Device List Block when this user is on the page:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/f/fcc101ef4c0d41054dd3b753f0aa67447bb7b767.png)
