system.tag.queryTagHistory issue

Hi everyone,

I have a problem with the scripting function in the object. I use it to retrieve a bunch of historical tags from a database, firing it from a calendar component, once a date has been selected.

Here is the function call I make with the properties I pass in:
dataSet= system.tag.queryTagHistory(paths=paths_to_query,,, returnSize=1, aggregationMode=“lastValue”, returnFormat=‘Wide’, ignoreBadQuality =‘false’)

paths_to_query is the array of tag paths of the tags I want to retrieve
startDate and endDate are the same, in particular the one selected in the calendar object

I show the dataset retrieved in a table.
When I query the db selecting a date for which I am sure data have been stored, everything works fine:

when I select a date for which there are no data stored or the gateway was not active, I get some values I don’t understand and a red overlay appears over the table’s fields:

The table’s quality property doesn’t change.

In this way, I can’t detect either the query runs fine or not.

Any suggestion?

First issue I see - ignoreBadQuality expects a boolean (in Python, literally True or False; 'false' is just a string.

For detecting a bad quality result - don’t look at the table’s overall data quality (it would have ‘bad’ quality if the tag history query itself didn’t work) - examine individual row quality using dataset.getQualityAt(row, col).