# Transform and continuity of errors

**URL:** <https://forum.inductiveautomation.com/t/transform-and-continuity-of-errors/93523>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [July 22, 2024, 11:21am UTC](https://forum.inductiveautomation.com/t/transform-and-continuity-of-errors/93523 "2024-07-22T11:21:15Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielps1818](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@danielps1818](https://forum.inductiveautomation.com/u/danielps1818)\
**Post date:** [July 22, 2024, 11:21am UTC](https://forum.inductiveautomation.com/t/transform-and-continuity-of-errors/93523/1 "2024-07-22T11:21:15Z")

</div>

Hello!

I currently have a tag that gives a string _(5%, 18%...)_ or nothing.

I'm writting it in a text field. The thing is,that I want it to show the string or "--"

So I tried this:

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

And it works!

However, it is possible to lose connection, so we need to show the label of "bad quality" that ignitions have. The problem is that the expression or script transformation doesn't continue the errors.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/0/b09e82f20c3405cd116280f83e0d65a4aa2a8904.png)

How could I do this?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [July 22, 2024, 12:53pm UTC](https://forum.inductiveautomation.com/t/transform-and-continuity-of-errors/93523/2 "2024-07-22T12:53:05Z")

</div>

I am guessing in designer your view.params.path is blank and so the tag path is not valid right now giving your that error. If you hover over the error with the mouse it should give you a bit more information.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [July 22, 2024, 1:28pm UTC](https://forum.inductiveautomation.com/t/transform-and-continuity-of-errors/93523/3 "2024-07-22T13:28:11Z")

</div>

Just like `isNull`, you can use `isBad`, `isBadOrError`, `isGood`... To implement any logic you want based on `value`'s quality

---

<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:** [July 22, 2024, 2:27pm UTC](https://forum.inductiveautomation.com/t/transform-and-continuity-of-errors/93523/4 "2024-07-22T14:27:44Z")

</div>

Also consider swapping to [`coalesce`](https://docs.inductiveautomation.com/docs/8.1/appendix/expression-functions/logic/coalesce) to wrap your null condition statement more concisely and avoid repeating the value input.

---

<div class="post-metadata">

**Author:** ![danielps1818](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@danielps1818](https://forum.inductiveautomation.com/u/danielps1818)\
**Post date:** [July 23, 2024, 8:38am UTC](https://forum.inductiveautomation.com/t/transform-and-continuity-of-errors/93523/5 "2024-07-23T08:38:14Z")

</div>

@pascal.fragnoud @paul-griffith the thing is that I want the error to continue, not get lost. Something like I did here with the map transform:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/2/923c110edd1e65bf9b4df2607e4527762b2c72e4.png)

The error continues but the value also gets updated correctly.

In the example I shown before, whenever the value gets returned the error simply is lost.

The same example as the first one but using a map transform (notice how the error gets shown in the text field on the right)

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

However, doing it like this is not viable.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [July 23, 2024, 8:46am UTC](https://forum.inductiveautomation.com/t/transform-and-continuity-of-errors/93523/6 "2024-07-23T08:46:19Z")

</div>

Use this to build a qualified value based on the quality of the value received.

> **[qualifiedValue | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/expression-functions/advanced/qualifiedValue)**
>
> Returns the given value, but overwrites the quality of that value.

edit:  
Actually, `forceQuality` would be simpler.  
to make it clear, it will look something like this:

```python
forceQuality(coalesce({value}, '--'), qualityOf({value}))

```

---

<div class="post-metadata">

**Author:** ![danielps1818](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@danielps1818](https://forum.inductiveautomation.com/u/danielps1818)\
**Post date:** [July 23, 2024, 9:37am UTC](https://forum.inductiveautomation.com/t/transform-and-continuity-of-errors/93523/7 "2024-07-23T09:37:56Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/9/d9805784b3115f5c63eb448943407c859c5a24c2.png)  
😕 ?

_the value is `""`_

Whatever, I'm just gonna do it another way using map transform. Is not worth it the extra work...

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [July 24, 2024, 7:44am UTC](https://forum.inductiveautomation.com/t/transform-and-continuity-of-errors/93523/8 "2024-07-24T07:44:54Z")

</div>

If coalesce doesn't return the default value, then the initial value provided isn't `null`.  
Check your values. If you're getting `""` instead of `"--"`, I'm willing to bet your input is not `null` but an empty string. Those are not the same thing.

Using a script transform for this IS extra work. The expression I provided above is exactly what you're asking for in the simplest possible form.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/9/f978adcec90558a75a4fdbf07df6daf8a269a52d.png) ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/a/4a09fb324cc7d6f0997ce5467ce5c5df869d6f97.png)

See how in your screenshot the `Tag` preview doesn't show `null` ?

---

<div class="post-metadata">

**Author:** ![hunterdg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hunterdg/32/67774_2.png) [@hunterdg](https://forum.inductiveautomation.com/u/hunterdg)\
**Post date:** [January 13, 2025, 7:22pm UTC](https://forum.inductiveautomation.com/t/transform-and-continuity-of-errors/93523/9 "2025-01-13T19:22:13Z")

</div>

on this note - is there a “better” way of getting expression language to treat empty strings as null without an ugly if/toBoolean statement?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/2/8205b53300199ffdf94524ee6975ccac3ca3b955.jpeg)

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [January 13, 2025, 7:36pm UTC](https://forum.inductiveautomation.com/t/transform-and-continuity-of-errors/93523/10 "2025-01-13T19:36:17Z")

</div>

No, because an empty string isn't the same as `null` or `none` in the expression language.

I would either insure that I can never get an empty string or just use an if statement to filter out an empty string.

```python
coalesce(if({something}="",null,{something}),"Something was null or empty")

```

Only advantage to that over a transform is, a pure expression will be more performant (not that it's really much).
