Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
Hi,
I have DataTable containing ID and Name of several different Things. On my Mashup i want to click on Grid row, with specyfic ID and Name and populate TimeSeriesChart with data from Thing.
And also - every Thing will be added by REST Api and there will be 300 of them, so adding it one by one to mashup will not work.
What is propper way to do that?
Please Help.
Solved! Go to Solution.
So you could start with either
GetImplementingThingsWithData that will get you the locations as well that you can then show on a map
Or use GetImplementingThings and use DeriveFields to add the location column - depending on number of properties, this might be more efficient
Next based on click, you can do a dynamicThingTemplate querystreamproperty(etc etc) type query to get the value stream entries of the entity clicked.
I hope I'm understanding your use case properly.
When you say Thing are you referring to actual Thingworx Things?
1. Why store them in a DataTable? Why not use something like GetImplementingThings against a Template?
2. Where is the time series chart data? Usually with the Things in the source, you can use selected row and fire another services to retrieve the time series data to display.
Yes, Things as Thingworx Things. More details is needed:
I have 300 Things. Every Thing implements the same template. Every Thing has Location property.
I need to show them on map, and be able to click them and show theirs values (including valueStream, wich is needed for TimeSeriesChart).
Right now i have created DataTable with Things Location to show markers on map, and service wich adds marker to map, when new Thing is created. But cannot link this to show Values.
OK,
I Created a TemplateThing with service. Service gets Thing by clicked Name, and fills TemplateThing with values. Although i cannot copy Value Stream with its historical Values. Is Any way to copy all valueStream?
Edit: Nah, this doesn't work - i have some services that i fire in mashup, and fireing it on TemplateThing is pointless.
Need help. I know that this should be easy - bunch of Things - must show them on map, and after clicking marker - Values are populated in Masup, including TimeSeriesChart. Please Someone Help:)
Edit 2:
I have Service like This
var things = ThingTemplates["AssetTemplate"].QueryImplementingThings({
maxItems: undefined /* NUMBER */,
nameMask: undefined /* STRING */,
query: undefined /* QUERY */,
tags: undefined
});
var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape({
infoTableName : "InfoTable",
dataShapeName : "AssetThingShape"
});
for(var i=0;(i<1000)&&(i<things.rows.length);i++) {
result.AddRow(things.rows[i]);
}
I have correct Infotable count (about 300) but values are empty.
So you could start with either
GetImplementingThingsWithData that will get you the locations as well that you can then show on a map
Or use GetImplementingThings and use DeriveFields to add the location column - depending on number of properties, this might be more efficient
Next based on click, you can do a dynamicThingTemplate querystreamproperty(etc etc) type query to get the value stream entries of the entity clicked.
I hope I'm understanding your use case properly.
I used this bits of information to make some progress. I think it will work. Thanks.