# Expression Try Tag not Found Failover

**URL:** <https://forum.inductiveautomation.com/t/expression-try-tag-not-found-failover/90632>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [May 20, 2024, 5:27pm UTC](https://forum.inductiveautomation.com/t/expression-try-tag-not-found-failover/90632 "2024-05-20T17:27:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [May 20, 2024, 5:27pm UTC](https://forum.inductiveautomation.com/t/expression-try-tag-not-found-failover/90632/1 "2024-05-20T17:27:45Z")

</div>

I have an expression on an INT tag in a UDT that is using `binEnc()` to combine some bits like so

```python
binEnc(
{[.]1},
{[.]2},
try({[.]3},0),
try({[.]4},0),
try({[.]5},0),
try({[.]6},0)
)

```

In this instance, only 1 and 2 exist. So, shouldn't 3, 4, 5, and 6 fail over to 0? My tag throws an error, saying the tag is not found. Shouldn't that error failover?

---

<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:** [May 20, 2024, 5:29pm UTC](https://forum.inductiveautomation.com/t/expression-try-tag-not-found-failover/90632/2 "2024-05-20T17:29:54Z")

</div>

Can you show the relevant UDT structure?

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [May 20, 2024, 5:31pm UTC](https://forum.inductiveautomation.com/t/expression-try-tag-not-found-failover/90632/3 "2024-05-20T17:31:46Z")

</div>

This is the INT with the expression.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/5/c575bab8a0397187bb32a686d97d54fefa41a383.png)

If I use

```python
binEnc(
{[.]1},
{[.]2},
if(isNull({[.]3}),0,{[.]3}),
if(isNull({[.]4}),0,{[.]4}),
if(isNull({[.]5}),0,{[.]5}),
if(isNull({[.]6}),0,{[.]6})
)

```

instead I get the result I want. I thought the `try` would behave the same and catch the null.

---

<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:** [May 20, 2024, 5:33pm UTC](https://forum.inductiveautomation.com/t/expression-try-tag-not-found-failover/90632/4 "2024-05-20T17:33:02Z")

</div>

I don't know, but wouldn't an INT have all 32 bits defined?

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [May 20, 2024, 5:33pm UTC](https://forum.inductiveautomation.com/t/expression-try-tag-not-found-failover/90632/5 "2024-05-20T17:33:52Z")

</div>

The rest would be 0 (implicit). Just combining these 6 into an INT (max 63) which can still be represented by a 32 bit

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [May 20, 2024, 5:39pm UTC](https://forum.inductiveautomation.com/t/expression-try-tag-not-found-failover/90632/6 "2024-05-20T17:39:54Z")

</div>

This is more readable

```python
binEnc(
	{[.]1},
	{[.]2},
	coalesce({[.]3}),0),
	coalesce({[.]4}),0),
	coalesce({[.]5}),0),
	coalesce({[.]6}),0),
)

```

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [May 20, 2024, 5:40pm UTC](https://forum.inductiveautomation.com/t/expression-try-tag-not-found-failover/90632/7 "2024-05-20T17:40:20Z")

</div>

Ya, that's what I was trying to do with the try! Just using the wrong function.

Thanks!
