# New Dialog open when variable is true

**URL:** <https://community.weweb.io/t/new-dialog-open-when-variable-is-true/15404>\
**Category:** How do I?\
**Created:** [January 14, 2025, 9:13pm UTC](https://community.weweb.io/t/new-dialog-open-when-variable-is-true/15404 "2025-01-14T21:13:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam1](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/sam1/32/6724_2.png) [@sam1](https://community.weweb.io/u/sam1)\
**Post date:** [January 14, 2025, 9:13pm UTC](https://community.weweb.io/t/new-dialog-open-when-variable-is-true/15404/1 "2025-01-14T21:13:17Z")

</div>

Hello,  
Im planning on having the dialog be in a component and then triggering the opening of the dialog from a global workflow. this means I don’t have access to the components workflow for opening the dialog and so I was hoping there would be a way to use a variable to trigger it being opened. Any other methods are also welcome

---

<div class="post-metadata">

**Author:** ![thomlov](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/thomlov/32/8591_2.png) [@thomlov](https://community.weweb.io/u/thomlov)\
**Post date:** [January 14, 2025, 10:22pm UTC](https://community.weweb.io/t/new-dialog-open-when-variable-is-true/15404/2 "2025-01-14T22:22:33Z")

</div>

Add a component property in your component, and bind it to your variable.

Create a component workflow, triggered by property change, that opens/closes dialog based on property value

---

<div class="post-metadata">

**Author:** ![sam1](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/sam1/32/6724_2.png) [@sam1](https://community.weweb.io/u/sam1)\
**Post date:** [January 14, 2025, 10:23pm UTC](https://community.weweb.io/t/new-dialog-open-when-variable-is-true/15404/3 "2025-01-14T22:23:49Z")

</div>

perfect that’ll work!

---

<div class="post-metadata">

**Author:** ![luka](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/luka/32/1571_2.png) [@luka](https://community.weweb.io/u/luka)\
**Post date:** [January 15, 2025, 9:37am UTC](https://community.weweb.io/t/new-dialog-open-when-variable-is-true/15404/4 "2025-01-15T09:37:12Z")

</div>

Would you prefer having an option to manually bind the open state of the dialog?

---

<div class="post-metadata">

**Author:** ![sam1](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/sam1/32/6724_2.png) [@sam1](https://community.weweb.io/u/sam1)\
**Post date:** [January 15, 2025, 9:59am UTC](https://community.weweb.io/t/new-dialog-open-when-variable-is-true/15404/5 "2025-01-15T09:59:46Z")

</div>

Yeah! That would be a nice feature I think

---

<div class="post-metadata">

**Author:** ![fredo22](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/fredo22/32/2283_2.png) [@fredo22](https://community.weweb.io/u/fredo22)\
**Post date:** [February 16, 2025, 5:01am UTC](https://community.weweb.io/t/new-dialog-open-when-variable-is-true/15404/6 "2025-02-16T05:01:53Z")

</div>

Related question here: I added the new dialog to a page. it opens if I use the trigger, but I want to be able to open the dialog via a variable. when I set the conditional display on the dialog element (through either conditional display method) - the dialog will not appear when the variable is true. Why is the dialog not showing? is this a bug with the new dialog element???

---

<div class="post-metadata">

**Author:** ![ericp](https://avatars.discourse-cdn.com/v4/letter/e/ea666f/32.png) [@ericp](https://community.weweb.io/u/ericp)\
**Post date:** [February 16, 2025, 1:15pm UTC](https://community.weweb.io/t/new-dialog-open-when-variable-is-true/15404/7 "2025-02-16T13:15:33Z")

</div>

Instead of setting the variable, why not use the component action and toggle the dialog directly? Works perfectly for me.

---

<div class="post-metadata">

**Author:** ![fredo22](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/fredo22/32/2283_2.png) [@fredo22](https://community.weweb.io/u/fredo22)\
**Post date:** [February 17, 2025, 4:07am UTC](https://community.weweb.io/t/new-dialog-open-when-variable-is-true/15404/8 "2025-02-17T04:07:04Z")

</div>

thanks eric. But how do I _“use the component action and toggle the dialog directly”?_ I want an icon to trigger this, but when I add a workflow step I can’t find any action listed that would trigger a component action…

UPDATE: I just found the option to execute a component action. Thanks for your help.

---

<div class="post-metadata">

**Author:** ![ericp](https://avatars.discourse-cdn.com/v4/letter/e/ea666f/32.png) [@ericp](https://community.weweb.io/u/ericp)\
**Post date:** [February 17, 2025, 4:43am UTC](https://community.weweb.io/t/new-dialog-open-when-variable-is-true/15404/9 "2025-02-17T04:43:38Z")

</div>

Glad you found it. I’m guessing you are like me, not a heavy user of custom components, as it took me a bit to figure it out to.

Another tip, if you copy a dialog from one page to another, you will also likely copy the workflow that triggers the dialog to an element (button) on the new page. You will need to edit the ‘execute component action’ to associate it to the copied dialog.

Overall, I think the new dialog is better than the old modal. Unfortunately I have a ton of modals, so I’m slowly migrating them over.
