cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

QueryImplementingThingsWithData output data shape

mlähde
3-Visitor

QueryImplementingThingsWithData output data shape

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?

1 ACCEPTED SOLUTION

Accepted Solutions

You are right on the second paragraph, you need to create a custom DataShape.

View solution in original post

3 REPLIES 3

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.

Top Tags