I'm attempting to use the "sort" query with QueryPropertyHistory but it is returning:
Error Executing Service
Unable to Invoke Service QueryPropertyHistory on dataHubThing : null
My query is:
{"sorts": [ { "fieldName": "flowRate" } ] }
If I use a "filter" it works just fine. As soon as I try a sort, it returns the above message.
Solved! Go to Solution.
It looks like this indeed isn't working, please submit this as a bug on support.ptc.com
in the mean time you can use the Sort function after you've done querypropertyhistory
What does the full script look like?
I'm just testing the QueryPropertyHistory and manually entering the query into the "query" field. No script.
It looks like this indeed isn't working, please submit this as a bug on support.ptc.com
in the mean time you can use the Sort function after you've done querypropertyhistory
Will do. Thank you. As a follow-up, the reason I want to sort is I'm having difficulties extracting all of the entries from QueryPropertyHistory and I wanted to view the effect of a sort that was passed as a parameter. If I run QueryPropertyHistory from 00:00:00 to 00:30:00, I get entries that are timestamped anywhere from 00:00:08, to 00:29:55, which is correct. However, if I increase the time window to 00:00:00 to 02:00:00, I get entries that are timestamped from 00:39:00 to 01:59:46. I lose all of the entries from 00:00:08 to 00:39:00! In order to view the data, I wrote a service that calls QueryPropertyHistory with oldestFirst as false and a maxRow parameter that is sufficiently large and then saves the entire table, row by row, into a dataTable (I know when you test QueryPropertyHistory you don't get the entire result in that window).
Is there anything to do with that 500-limitation, that it returns only first 500 entries?
When I execute that custom service I output the length of the returned table from QueryPropertyHistory. It's returning around 680 rows.