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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Get list of all properties implemented in a ThingShape

amittal-3
14-Alexandrite

Get list of all properties implemented in a ThingShape

Hello,

Is there a way to get all the properties implemented in a ThingShape? For a Thing if I use the method "GetPropertyDefinitions()" it works fine

var params = {
			category: undefined /* STRING */,
			type: undefined /* BASETYPENAME */,
			dataShape: undefined /* DATASHAPENAME */
		};
        result = Things["MyThing"].GetPropertyDefinitions(params);

//This Works fine, I get the infotable with the list of all the properties

; but when I use it with ThingShape, it returns me a blank infotable.

var params = {
			category: undefined /* STRING */,
			type: undefined /* BASETYPENAME */,
			dataShape: undefined /* DATASHAPENAME */
		};
        result = ThingShapes["MY_THINGSHAPE"].GetPropertyDefinitions(params);

//This returns a blank infotable

Any help would be appreciated.

Thanks in advance

- Aditya Mittal

ACCEPTED SOLUTION

Accepted Solutions

You can try this one:

 

 var params = { type: undefined /* STRING */ }; 
// result: INFOTABLE dataShape: PropertyDefinition
var result = ThingShapes["TS1"].GetInstancePropertyDefinitions(params);

Best,

Adam

View solution in original post

3 REPLIES 3

You can try this one:

 

 var params = { type: undefined /* STRING */ }; 
// result: INFOTABLE dataShape: PropertyDefinition
var result = ThingShapes["TS1"].GetInstancePropertyDefinitions(params);

Best,

Adam

kthamma
5-Regular Member
(To:A_Macierzynski)

Is there a way to pull Thing shapes that are in a implemented Thing?

amittal-3
14-Alexandrite
(To:kthamma)

Hi,

I think you can try to use the service 'GetImplementedShapes'. Its a generic service. It will return you the list (infotable) of all the implemented thingshapes for a particular thing.

I hope it helps!!

Thanks

Aditya

Announcements


Top Tags