Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Dear Team,
I am getting tabular data after calling below code as result output is JSON.
var params = {
oldestFirst: undefined /* BOOLEAN */,
maxItems: undefined /* NUMBER */,
sourceTags: undefined /* TAGS */,
endDate: undefined /* DATETIME */,
query: undefined /* QUERY */,
source: undefined/* STRING */,
startDate: undefined /* DATETIME */,
tags: undefined /* TAGS */
};
// result: INFOTABLE
var result2 = Things["PumpValueStream"].QueryStreamEntriesWithData(params);
var params = {
table: result2 /* INFOTABLE */
};
// result: JSON
var result = Resources["InfoTableFunctions"].ToJSON(params);
Hi, below is a simple example of using toJson snippet, converting from an existing infotable (with a datashape) to json:
Or with a query,
Keep in mind such a result would be displayed in a tabular format. However, you may save it to, for example, a property
result = table1.ToJSON();
Then when the property is assigned the converted toJson data, you will see the following: