# Expression Tag Broken After 8.1 Upgrade

**URL:** <https://forum.inductiveautomation.com/t/expression-tag-broken-after-8-1-upgrade/65902>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [October 31, 2022, 7:53pm UTC](https://forum.inductiveautomation.com/t/expression-tag-broken-after-8-1-upgrade/65902 "2022-10-31T19:53:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Zetterman](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@Matt\_Zetterman](https://forum.inductiveautomation.com/u/Matt_Zetterman)\
**Post date:** [October 31, 2022, 7:53pm UTC](https://forum.inductiveautomation.com/t/expression-tag-broken-after-8-1-upgrade/65902/1 "2022-10-31T19:53:05Z")

</div>

We have an expression tag that counts up from 0 every second until it reaches 600 seconds. It worked fine until we upgraded from 7.9 to 8.1. This is the function: `IF({[.]Counter}<600,{[.]Counter}+1,0)`. It now returns an error: [null, Error\_ExpressionEval("If function got a null first argument"). Did something change to break this expression? Thank you.

---

<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:** [October 31, 2022, 7:57pm UTC](https://forum.inductiveautomation.com/t/expression-tag-broken-after-8-1-upgrade/65902/2 "2022-10-31T19:57:58Z")

</div>

Tip: use the \</\> code formatting button to preserve code indentation and apply syntax highlighting.

```auto
if({[.]Counter} < 600, {[.]Counter} + 1, 0)

```

Can you show the tag setup? Is `Counter` a self reference or a reference to something else?

---

<div class="post-metadata">

**Author:** ![Matt\_Zetterman](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@Matt\_Zetterman](https://forum.inductiveautomation.com/u/Matt_Zetterman)\
**Post date:** [October 31, 2022, 7:59pm UTC](https://forum.inductiveautomation.com/t/expression-tag-broken-after-8-1-upgrade/65902/3 "2022-10-31T19:59:41Z")

</div>

Thanks for the response. It's a self reference.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [October 31, 2022, 8:11pm UTC](https://forum.inductiveautomation.com/t/expression-tag-broken-after-8-1-upgrade/65902/4 "2022-10-31T20:11:57Z")

</div>

It's probably been converted to use the event driven execution mode instead of tag group to update the tag. 99% of expression tags should use this, butIn this case, using a curricular reference would yield terrible results. Try changing it back to a tag group

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 31, 2022, 8:14pm UTC](https://forum.inductiveautomation.com/t/expression-tag-broken-after-8-1-upgrade/65902/5 "2022-10-31T20:14:52Z")

</div>

It'll never start up with v8.1. It's null to begin with, so the comparison will always choke. Wrap the entire expression in a `try()` function, to get you a zero to start.

---

<div class="post-metadata">

**Author:** ![Matt\_Zetterman](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@Matt\_Zetterman](https://forum.inductiveautomation.com/u/Matt_Zetterman)\
**Post date:** [November 1, 2022, 11:46am UTC](https://forum.inductiveautomation.com/t/expression-tag-broken-after-8-1-upgrade/65902/6 "2022-11-01T11:46:42Z")

</div>

Worked like a charm. Thank you very much.
