Dataset Tag read values

We currently have a dataset tag that is filled using a SQL Query.
It works fine for binding to the elements of the array, but we cannot seem to get to the values using system.tag.read calls.
in example on a button:

valToRead = system.tag.read("DatasetTag[ITEM1][0,8]").value

Brings the following error. Note the above tag path was built using the builtin tag browse on the script editor window.

ValueError: com.google.common.collect.ComputationException: com.inductiveautomation.ignition.common.sqltags.parser.TagPathFormatException: Illegal character '[' (Line 1 , Char 33)

1 Like

You’ll need to use system.tag.read to bring in the entire dataset, then .getValueAt(row, col):

system.tag.read("DatasetTagPath").value.getValueAt(0, 8)

1 Like

Thanks,
I figured as much and was already doing it similarly.
Can we get the Tag browse filtered to not include the dataset elements?
It gets tiresome answering calls about things like that lol

I am trying to do something similar but need help…I know it is a simple just cant can get the correct syntax.

data = system.tag.read(“SLI/Charlotte/Bakery/Generic Case/14x8[Item Description Line 1]”).value.getValueAt(0, 1)

Getting Error: com.google.common.collect.ComputationException: com.inductiveautomation.ignition.common.sqltags.parser.TagPathFormatException: Illegal character ‘[’ (Line 1 , Char 39)

I want to be able to loop thru all the sub datasets.
This is the path via CopyTagPath
SLI/Charlotte/Bakery/Generic Case/14x8[Item Description Line 1][1, 4]

Give this a try:

rowZeroItemDesc = system.tag.read("SLI/Charlotte/Bakery/Generic Case/14x8").value.getValueAt(0, "Item Description Line 1")

I’ve used this particular page from the docs quite a lot in the past, just in case you haven’t found it yet:
Working with Datasets

Hope this helps!

1 Like

Symilar here. Client DataSet tag St020_Data
Running Ignition 7.7.2.
tried :
data = system.tag.read("[]/Client/Stations/St020_Data").value
FieldValue = data.getValueAt(0,1)

but get error :

Traceback (most recent call last):
File “event:propertyChange”, line 16, in
AttributeError: ‘int’ object has no attribute ‘getValueAt’

Ignition v7.7.2 (b2014121709)
Java: Oracle Corporation 1.8.0_60

Any ideas?

1 Like