# How can I detect changes in varaibles?

**URL:** https://discourse.nodered.org/t/how-can-i-detect-changes-in-varaibles/48316
**Category:** General
**Created:** [12 July 2021 13:26 UTC](https://discourse.nodered.org/t/how-can-i-detect-changes-in-varaibles/48316 "2021-07-12T13:26:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![juan\_R](https://avatars.discourse-cdn.com/v4/letter/j/ad7895/32.png) [@juan\_R](https://discourse.nodered.org/u/juan_R)
#### Post date: [12 July 2021 13:26 UTC](https://discourse.nodered.org/t/how-can-i-detect-changes-in-varaibles/48316/1 "2021-07-12T13:26:36Z")

</div>

Hello everyone,

I am developing a code and I want to active a "controler" for see the value of one variable in a period of time.

Right now I do this:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/3/63d6ab515aa2d7cbe2b0735e8cb80eccb715a2a6.png)

The inyect repeat every second and in the function I check the value of the variable.  
I think this may overload my microo and I would like to be able to stop the inject when the variable changes value.

any recommendations on how I can do this in a better way? I am new in node-red.

thank you in advance

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [12 July 2021 13:31 UTC](https://discourse.nodered.org/t/how-can-i-detect-changes-in-varaibles/48316/2 "2021-07-12T13:31:53Z")

</div>

Use the RBE node to detect changes...

> [@juan\_R](#):
>
> The inyect repeat every second and in the function I check the value of the variable.  
> I think this may overload my microo

Not likely - that is a very basic and small task for node-red.

Can you not use the part of your flow that updates this variable - with an RBE node to detect changes instead of polling it every 1 second?

> [@juan\_R](#):
>
> I am new in node-red.

As a new user, I recommend watching this playlist: [Node-RED Essentials](https://www.youtube.com/playlist?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6). The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [10 September 2021 13:32 UTC](https://discourse.nodered.org/t/how-can-i-detect-changes-in-varaibles/48316/3 "2021-09-10T13:32:29Z")

</div>

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