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?
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
?
and what are the 5 warnings on the props?
We are using version 8.1.1
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.
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.
What do the warnings say
All of the warning just say “invalid key” but I get those every time and it still works most of the time
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
Thanks, I’ll give it a shot
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.
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.