# Tag Expression not going true with System/Gateway Network tags

**URL:** <https://forum.inductiveautomation.com/t/tag-expression-not-going-true-with-system-gateway-network-tags/101997>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [February 6, 2025, 7:32pm UTC](https://forum.inductiveautomation.com/t/tag-expression-not-going-true-with-system-gateway-network-tags/101997 "2025-02-06T19:32:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Logan\_Krohn](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@Logan\_Krohn](https://forum.inductiveautomation.com/u/Logan_Krohn)\
**Post date:** [February 6, 2025, 7:32pm UTC](https://forum.inductiveautomation.com/t/tag-expression-not-going-true-with-system-gateway-network-tags/101997/1 "2025-02-06T19:32:17Z")

</div>

![Screenshot 2025-02-06 132655](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/1/710fd64c8c7fa7227a574fdf67b3222c072967c4.png)  
 ![Screenshot 2025-02-06 132733](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/f/2f47a90dd85cea7f5093b6bdfc2201106cc5b794.png)  
 ![Screenshot 2025-02-06 133131](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/7/674f1c7c4537eecaa11a00fa6a4648cf0852936e.png)

I am having trouble with my expression not going true even though both conditions are right for it to be. The screenshots were taken at 1:27 but the tag is false right now. Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 6, 2025, 7:39pm UTC](https://forum.inductiveautomation.com/t/tag-expression-not-going-true-with-system-gateway-network-tags/101997/2 "2025-02-06T19:39:26Z")

</div>

I can see two possible problems.

First, the `&&` has a higher precedence than the `= False`, so your expression is evaluating incorrectly, I'm pretty sure.

Second, you don't have a poll rate on `now()`, so your expression isn't re-evaluating during downtime.

I would rewrite it like this:  
`!{IsAvailableTag} && minutesBetween({uptimeTag}, now(60000)) > 5`

Note that there's zero reason to include an `if(condition, True, False)` - you can just write your condition out, and it'll automatically return a boolean result (or be adapted to a boolean by whatever context is running the expression).

---

<div class="post-metadata">

**Author:** ![Logan\_Krohn](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@Logan\_Krohn](https://forum.inductiveautomation.com/u/Logan_Krohn)\
**Post date:** [February 6, 2025, 7:42pm UTC](https://forum.inductiveautomation.com/t/tag-expression-not-going-true-with-system-gateway-network-tags/101997/3 "2025-02-06T19:42:24Z")

</div>

Thank you so much and I did not know that I the if statement was not needed. I appreciate it!

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 6, 2025, 8:04pm UTC](https://forum.inductiveautomation.com/t/tag-expression-not-going-true-with-system-gateway-network-tags/101997/4 "2025-02-06T20:04:38Z")

</div>

Tip: post formatted code instead of or as well as the screengrab so we can copy, test and edit it. Please see [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831). Also, you can break lines in expressions and use indentation to make them more readable. The interpreter ignores line breaks, tabs and multiple spaces.
