Bind to tags in table data

Hi,

I have put a table, for which the data is taken from a sql query.

The sql query returns 5 columns. Among that, one column returns a tag path(channel/device/tag/amps).

In table, it’s displayed as path. However, we want to display the tag value, instead of path.

Is it possible to map the column attributes as indirect tags.?

Please help me in resolving this issue.

Thanks!!!

Not directly, no. But you can use a propertyChange event for the query result to run a script that does the lookups with system.tag.readAll() then construct another dataset with those values using system.dataset.toDataSet().

Thanks for the reply.

I’m trying to achieve the functionality which you have advised. However, my code is not working properly.

Please check the below code.

In propertyChange event :
table = event.source.parent.getComponent(‘Table 1’)
data = system.dataset.toPyDataSet(table.data)
project.WellListData.generateTableData(data)

In script:

def generateTableData(data):
value= []
for row in data:
value = row[“Amps”]
# values = system.tag.read(value)

values = system.tag.readAll(value) 		

The above code is giving errors in the readAll statement, as ‘1st arg can’t be coerced to String[]’. Also, after reading tag values, we need to add it to dataset. As iam new to ignition, iam bit struggling to write this code.

Can you please guide me with sample code,if you have any.

Thanks in advance.

Sudha