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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

QueryImplementingThingsWithData output data shape

mlähde
10-Marble

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?

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.

Announcements


Top Tags