# Ignore null on text props perspective Text Field

**URL:** <https://forum.inductiveautomation.com/t/ignore-null-on-text-props-perspective-text-field/78202>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [August 22, 2023, 7:55am UTC](https://forum.inductiveautomation.com/t/ignore-null-on-text-props-perspective-text-field/78202 "2023-08-22T07:55:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![avantica](https://avatars.discourse-cdn.com/v4/letter/a/f0a364/32.png) [@avantica](https://forum.inductiveautomation.com/u/avantica)\
**Post date:** [August 22, 2023, 7:55am UTC](https://forum.inductiveautomation.com/t/ignore-null-on-text-props-perspective-text-field/78202/1 "2023-08-22T07:55:32Z")

</div>

Hi all

Does anyone know a way we can ignore 'null' values on text props?

![Screenshot 2023-08-22 155308](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/3/f300cede03127ae25afccdb05d79cfa47231b6bb.png)  
 ![Screenshot 2023-08-22 155251](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/8/38abefa9895afb41827548cdaef2c5427f7c346d.png)

---

<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:** [August 22, 2023, 7:57am UTC](https://forum.inductiveautomation.com/t/ignore-null-on-text-props-perspective-text-field/78202/2 "2023-08-22T07:57:53Z")

</div>

Yes: close your eyes and pretend it's not there.

We need more details about what you're doing: How is text populated, what you're trying to fix, etc.

> **[The XY Problem](https://xyproblem.info/)**
>
> Asking about your attempted solution rather than your actual problem

---

<div class="post-metadata">

**Author:** ![avantica](https://avatars.discourse-cdn.com/v4/letter/a/f0a364/32.png) [@avantica](https://forum.inductiveautomation.com/u/avantica)\
**Post date:** [August 22, 2023, 8:18am UTC](https://forum.inductiveautomation.com/t/ignore-null-on-text-props-perspective-text-field/78202/3 "2023-08-22T08:18:10Z")

</div>

The text field is binded to a custom component property which the object is populated from a database query returned as a json.

![Screenshot 2023-08-22 161641](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/1/8177554a67139f516c1404db5f34e5dbf832dc37.png)

---

<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:** [August 22, 2023, 8:22am UTC](https://forum.inductiveautomation.com/t/ignore-null-on-text-props-perspective-text-field/78202/4 "2023-08-22T08:22:44Z")

</div>

I'll assume you need to keep the nulls in the `custom.data` property because you need that data for other things, and that the `text` property is a simple property binding.  
I'd change that property binding to an expression binding that would look like this:  
`coalesce({property_path}, default_value)`

With `default_value` probably `""`, but you can put whatever you want to use instead of `null`

---

<div class="post-metadata">

**Author:** ![Priyanka.Khandge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/priyanka.khandge/32/35989_2.png) [@Priyanka.Khandge](https://forum.inductiveautomation.com/u/Priyanka.Khandge)\
**Post date:** [August 22, 2023, 9:45am UTC](https://forum.inductiveautomation.com/t/ignore-null-on-text-props-perspective-text-field/78202/5 "2023-08-22T09:45:15Z")

</div>

@avantica Update your SQL query like:

```auto
SELECT 
ID,
isnull(Address1, ' ') AS Address1
FROM Sample

```

---

<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:** [August 22, 2023, 2:38pm UTC](https://forum.inductiveautomation.com/t/ignore-null-on-text-props-perspective-text-field/78202/6 "2023-08-22T14:38:18Z")

</div>

While it's (probably) usually better to handle things in the query, in this case I wouldn't, because he might need the nulls in the source data and to only replace them in some labels.  
But that's just an assumption I'm making. Nulls are a valuable absence of value !

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [August 22, 2023, 2:45pm UTC](https://forum.inductiveautomation.com/t/ignore-null-on-text-props-perspective-text-field/78202/7 "2023-08-22T14:45:48Z")

</div>

We need to see your binding. The best option is probably just to capture the null value in a transform and return an empty string to the Text Field instead.

---

<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:** [August 22, 2023, 2:53pm UTC](https://forum.inductiveautomation.com/t/ignore-null-on-text-props-perspective-text-field/78202/8 "2023-08-22T14:53:01Z")

</div>

I'm guessing his binding is a property binding, which makes the transform overkill when there the `coalesce` expression function available.

Edit:  
huh, scratch that.  
If `custom.data` is dynamic, the binding might not be a simple property binding.
