# Binding output becoming null in the data property of a table

**URL:** <https://forum.inductiveautomation.com/t/binding-output-becoming-null-in-the-data-property-of-a-table/48540>\
**Category:** General Discussion\
**Created:** [July 6, 2021, 5:55pm UTC](https://forum.inductiveautomation.com/t/binding-output-becoming-null-in-the-data-property-of-a-table/48540 "2021-07-06T17:55:14Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jack.dessart](https://avatars.discourse-cdn.com/v4/letter/j/ad7895/32.png) [@jack.dessart](https://forum.inductiveautomation.com/u/jack.dessart)\
**Post date:** [July 6, 2021, 5:55pm UTC](https://forum.inductiveautomation.com/t/binding-output-becoming-null-in-the-data-property-of-a-table/48540/1 "2021-07-06T17:55:14Z")

</div>

![Untitled](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/9/f90e1c6a5a334628aa7dc67faa72a28a4f9f0325.png)

This script evaluates correctly, and then the data that is being bound to it comes up as null.  
I have pressed apply on the binding and saved my work, but then when I go into preview mode and try to pull up the values in the table this happens every time.  
Can someone explain what might be the problem here?

---

<div class="post-metadata">

**Author:** ![matthew.ayre](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matthew.ayre/32/19499_2.png) [@matthew.ayre](https://forum.inductiveautomation.com/u/matthew.ayre)\
**Post date:** [July 8, 2021, 7:27am UTC](https://forum.inductiveautomation.com/t/binding-output-becoming-null-in-the-data-property-of-a-table/48540/2 "2021-07-08T07:27:26Z")

</div>

Hi @jack.dessart, that does kind of look like a bug. What version are you on?

Also, is it possible to see the full script and the value of `tagTab`?

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [July 8, 2021, 9:57am UTC](https://forum.inductiveautomation.com/t/binding-output-becoming-null-in-the-data-property-of-a-table/48540/3 "2021-07-08T09:57:28Z")

</div>

and what are the 5 warnings on the props?

---

<div class="post-metadata">

**Author:** ![jack.dessart](https://avatars.discourse-cdn.com/v4/letter/j/ad7895/32.png) [@jack.dessart](https://forum.inductiveautomation.com/u/jack.dessart)\
**Post date:** [July 8, 2021, 1:53pm UTC](https://forum.inductiveautomation.com/t/binding-output-becoming-null-in-the-data-property-of-a-table/48540/4 "2021-07-08T13:53:38Z")

</div>

We are using version 8.1.1

 ![dataBinding](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/2/a21cccfbf4ad057cc8964937725f196f695cce87.png)  
Here is a picture of the script and the tagTab property (open on the right side).  
The tagTab property just has the aggregate style, the names, and the path to each tag.  
And the script takes a user selected date and does a system.tag.queryTagHistory with the tag paths and the time to return a dataset. then I just loop through and format all of it into a json file so that I can make a single table out of the information.

---

<div class="post-metadata">

**Author:** ![matthew.ayre](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matthew.ayre/32/19499_2.png) [@matthew.ayre](https://forum.inductiveautomation.com/u/matthew.ayre)\
**Post date:** [July 8, 2021, 2:15pm UTC](https://forum.inductiveautomation.com/t/binding-output-becoming-null-in-the-data-property-of-a-table/48540/5 "2021-07-08T14:15:14Z")

</div>

EDIT: What I said is not strictly true 😅 It all ends up as JSON in the end.

~~Right, just to confirm you are not outputting JSON are you?~~

 

~~The table expects an array of arrays/objects. It can interpret Python lists as Ignition arrays and Python dictionaries as Ignition objects. It looks like you are doing this, but I just wanted to make sure you are not actually doing some form of conversion to JSON at the end.~~

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [July 8, 2021, 2:17pm UTC](https://forum.inductiveautomation.com/t/binding-output-becoming-null-in-the-data-property-of-a-table/48540/6 "2021-07-08T14:17:41Z")

</div>

> [@victordcq](#):
>
> and what are the 5 warnings on the props?

What do the warnings say ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/8/e81096aab89d2b996fa8173e862544529f24a251.png)

---

<div class="post-metadata">

**Author:** ![jack.dessart](https://avatars.discourse-cdn.com/v4/letter/j/ad7895/32.png) [@jack.dessart](https://forum.inductiveautomation.com/u/jack.dessart)\
**Post date:** [July 8, 2021, 2:21pm UTC](https://forum.inductiveautomation.com/t/binding-output-becoming-null-in-the-data-property-of-a-table/48540/7 "2021-07-08T14:21:38Z")

</div>

All of the warning just say “invalid key” but I get those every time and it still works most of the time

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [July 8, 2021, 2:27pm UTC](https://forum.inductiveautomation.com/t/binding-output-becoming-null-in-the-data-property-of-a-table/48540/8 "2021-07-08T14:27:05Z")

</div>

hmm  
you should put in a bunch of custom params and throught the script assign values to it  
like  
custom params = key, key\_1,key\_2  
self.custom.key = value  
self.custom.key\_1 = output\_json  
maybe in the loop = self.custom.key\_2 = str(self.custom.key\_2) + str(i)  
…

that should help find where it goes wrong

---

<div class="post-metadata">

**Author:** ![jack.dessart](https://avatars.discourse-cdn.com/v4/letter/j/ad7895/32.png) [@jack.dessart](https://forum.inductiveautomation.com/u/jack.dessart)\
**Post date:** [July 8, 2021, 2:28pm UTC](https://forum.inductiveautomation.com/t/binding-output-becoming-null-in-the-data-property-of-a-table/48540/9 "2021-07-08T14:28:13Z")

</div>

Thanks, I’ll give it a shot

---

<div class="post-metadata">

**Author:** ![Lokmen\_Farhat](https://avatars.discourse-cdn.com/v4/letter/l/85f322/32.png) [@Lokmen\_Farhat](https://forum.inductiveautomation.com/u/Lokmen_Farhat)\
**Post date:** [August 31, 2024, 10:20am UTC](https://forum.inductiveautomation.com/t/binding-output-becoming-null-in-the-data-property-of-a-table/48540/10 "2024-08-31T10:20:00Z")

</div>

I faced a similar issue. What you need to do is to make sure that all variables called inside an expression are "persistent" or have been assigned a default value.

For example, let's say I have a custom property called "width". This property has a binding that reads the column names of a table, calculates the length of every name and then returns the maximum value.  
In this case, to avoid having a null value when starting the view, you need to right click on the table dataset and check that the "persistent" mode is active.

---

<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:** [August 31, 2024, 12:16pm UTC](https://forum.inductiveautomation.com/t/binding-output-becoming-null-in-the-data-property-of-a-table/48540/11 "2024-08-31T12:16:37Z")

</div>

> [@Lokmen\_Farhat](#):
>
> to avoid having a null value when starting the view

While making source properties persistent solves some cases, having stale data at view startup is often a huge problem. An expression can use `isNull()` to detect such startup cases to return an intelligent placeholder, or use `coalesce()` to substitute a suitable "empty" value for the null.
