getDataset from root container

ignition79
#1

I made a root container dataset property to query a database and get all of my data for a part.
I tried to use getDatasetValueByName in an expression on a label to get a value out of the root container dataset that i created but that seems to be the wrong implementation of that.

So may question is how can I get specific data out of a custom property dataset?

0 Likes

#2

Just put row and column in square brackets in your binding expression after the property reference. I generally include the try() function to catch missing datasets during startup. Something like this for the value in the first row, first column:

try({Root Container.SomeProperty}[0, 0], 0)

The row and column can be other properties, of course. And the column can be a string column name instead of an index.

0 Likes

#3

That works perfect.

Where is this in the help file, so next time I have an idea where to look.

0 Likes

#4

https://docs.inductiveautomation.com/display/DOC80/Expression+Overview+and+Syntax#ExpressionOverviewandSyntax-DatasetAccess

1 Like