How to convert QueryResults to Dataset?

I have a need to convert a reports Tag Historian Query results to a dataset. Could anyone tell me how to achieve this?

Here’s a mockup of the report data source:
image

I want to use the data from the 1st data source in the Script without having to re-query the database.
When I log the type of the the results from the Tag Historian Query I get type com.inductiveautomation.reporting.common.api.QueryResults

Thanks

com.inductiveautomation.reporting.common.api.QueryResults#getCoreResults returns a Dataset - just call data["tag_history"].getCoreResults().

2 Likes

Thanks @PGriffith.
I just found the reference in the docs for that.