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 community,
If I add a template's QueryImplementingThingsWithData service as a data source in a mashup, it returns a list of all the properties defined in that template. All good there.
But: I want to wrap this service call inside a service of my own. Which data shape should I use as the output data shape to get the aforementioned result? Do I always need to create a new data shape of my own?
When creating a new service, under the Entities tab I can find the following code for calling QueryImplementingThingsWithData:
var params = {
maxItems: undefined /* NUMBER */,
nameMask: undefined /* STRING */,
query: undefined /* QUERY */,
tags: undefined /* TAGS */
};
// result: INFOTABLE dataShape: RootEntityList
var result = ThingTemplates["MyTemplate"].QueryImplementingThingsWithData(params);
Judging by this, the output data shape should be RootEntityList. However, RootEntityList only defines the following properties: avatar, description, homeMashup, isSystemObject, name, tags. Likewise, when I add this custom service as a data source in the mashup builder, these are the only properties that are in the returned data. Thus all other properties defined in the template are unbindable in mashup builder. What gives?
Solved! Go to Solution.
You are right on the second paragraph, you need to create a custom DataShape.
You are right on the second paragraph, you need to create a custom DataShape.
Ok, thank you.
I guess then my question would be, why does the QueryImplementingThingsWithData service (or any other similar service) work without declaring a data shape when called directly from a mashup? Is there some underlying logic that does it dynamically?
We don't have that option, this is only done by built-in services.
You can have kind of dynamic service result binding using Grid Widget ( with Show All Columns to true ) also TimeSeries Graphs can handle it.