# Is it possible to listen for a variable value rather than triggering on variable change with a custom widget?

**URL:** <https://community.tulip.co/t/is-it-possible-to-listen-for-a-variable-value-rather-than-triggering-on-variable-change-with-a-custom-widget/11715>\
**Category:** Support, Troubleshooting, & Help\
**Tags:** custom-widgets\
**Created:** [June 11, 2024, 7:21pm UTC](https://community.tulip.co/t/is-it-possible-to-listen-for-a-variable-value-rather-than-triggering-on-variable-change-with-a-custom-widget/11715 "2024-06-11T19:21:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![btimm](https://avatars.discourse-cdn.com/v4/letter/b/e79b87/32.png) [@btimm](https://community.tulip.co/u/btimm)\
**Post date:** [June 11, 2024, 7:21pm UTC](https://community.tulip.co/t/is-it-possible-to-listen-for-a-variable-value-rather-than-triggering-on-variable-change-with-a-custom-widget/11715/1 "2024-06-11T19:21:25Z")

</div>

I’m having trouble finding a way to get my custom widget to run triggers based on the value of a variable rather than triggering on a variable change. I need to be able to keep running the triggers until my request bit has been updated back to a value of 0 but I also can’t loop within the widget because I need it to process other triggers between it’s own runs.

Is there a way to manage this without using an additional “handler” custom widget to manage requests?

---

<div class="post-metadata">

**Author:** ![Beth](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/beth/32/5987_2.png) [@Beth](https://community.tulip.co/u/Beth)\
**Post date:** [June 12, 2024, 1:30pm UTC](https://community.tulip.co/t/is-it-possible-to-listen-for-a-variable-value-rather-than-triggering-on-variable-change-with-a-custom-widget/11715/2 "2024-06-12T13:30:38Z")

</div>

Hi Bryan! Welcome to Tulip Community 🎉

Do you mind sharing a bit more bout your use case and what the goal of your custom widget is? Any screenshots you can provide may be helpful as well!

---

<div class="post-metadata">

**Author:** ![danielpomeranz](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/danielpomeranz/32/9379_2.png) [@danielpomeranz](https://community.tulip.co/u/danielpomeranz)\
**Post date:** [June 12, 2024, 3:05pm UTC](https://community.tulip.co/t/is-it-possible-to-listen-for-a-variable-value-rather-than-triggering-on-variable-change-with-a-custom-widget/11715/3 "2024-06-12T15:05:58Z")

</div>

Hey Bryan,

If you look at my response to this similar community question, I believe you should be able to grasp how this can be achieved.

> [@JavaScript timer reset time](https://community.tulip.co/t/javascript-timer-reset-time/11565):
>
> Hi, I am new to the tulip application and trying to figure this out. The code I will have down below is the code to my timer that i have made and what i need it to do is for when one of the triggers go off i just want the timer to reset and just start from zero again. But the issue im having is how can i have a trigger reach out and tell the java code to reset the time. Thank you for any help. label { display:inline; color: green; font-family:…

---

<div class="post-metadata">

**Author:** ![btimm](https://avatars.discourse-cdn.com/v4/letter/b/e79b87/32.png) [@btimm](https://community.tulip.co/u/btimm)\
**Post date:** [June 12, 2024, 5:29pm UTC](https://community.tulip.co/t/is-it-possible-to-listen-for-a-variable-value-rather-than-triggering-on-variable-change-with-a-custom-widget/11715/4 "2024-06-12T17:29:18Z")

</div>

Hi Beth,

The basic premise is that I am creating apps that run a lot of API/connector calls. I have some groups of 3-5 triggers that I would like to abstract out of the step triggers because I run them so many times. I thought the easy way to do this would be to just set a “request” variable to true and run the group of triggers on that variable state. Turns out tulip doesn’t have a way to trigger on variable states (or values) so I built my own custom widget to do it in the background at widget level.

I now have run into the need for my custom widget to call itself again if the responses aren’t correct or would have changed. So the following is a simplified set of steps I’m going through:

1. Step trigger: writes 1 to “request” variable
2. Custom widget: sees that “request” = 1
3. Custom widget: runs group of connector functions to input part status info
4. Custom widget: sets “request” variable to 0
5. Custom widget: runs group of connector functions to output changes to part info
6. Custom widget: sets “request” variable back to 1
7. Custom widget: process complete
8. [Custom widget should run again because “request” = 1] (I have not gotten this to work)

Does this make some sense?

---

<div class="post-metadata">

**Author:** ![btimm](https://avatars.discourse-cdn.com/v4/letter/b/e79b87/32.png) [@btimm](https://community.tulip.co/u/btimm)\
**Post date:** [June 12, 2024, 5:41pm UTC](https://community.tulip.co/t/is-it-possible-to-listen-for-a-variable-value-rather-than-triggering-on-variable-change-with-a-custom-widget/11715/5 "2024-06-12T17:41:43Z")

</div>

Hey, it sounds like the widget should have the possibility to run itself based on a timer. What is unclear to me is if the custom widget code runs every time the Tulip step functionality scans through synchronously or if it calls the custom widget code asynchronously based on a variable change event.
