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 an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Retrieve all properties from a thing

frank247
6-Contributor

Retrieve all properties from a thing

Hello,

 

I have the following challenge: I want to extract all properties, which are available/present on a certain thing, to an info table. I used the following code to achieve this:

 

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

 

My problem is, that it gets me only 999 entries but my thing has more that 999 properties.

Is there a way to get more/all entries? maxItems did not work.

ACCEPTED SOLUTION

Accepted Solutions
frank247
6-Contributor
(To:PaiChung)

Hi PaiChung,

thank you for the feedback. All properties of the relevant Thing are grouped on various ThingShapes.

I solved the issue in the following way:

 

getImplementedShapes > InfoTable with all Shapes

Iterate through Shapes InfoTable and use > GetInstancePropertyDefinitions > retrieve all properties and write them to an Property InfoTable.

 

 

View solution in original post

3 REPLIES 3
PaiChung
22-Sapphire I
(To:frank247)

That seems like way too many properties on a Thing, but perhaps you can group those into ThingShapes and retrieve the ThingShapes and then the properties so there are less than 999 per ThingShape.

frank247
6-Contributor
(To:PaiChung)

Hi PaiChung,

thank you for the feedback. All properties of the relevant Thing are grouped on various ThingShapes.

I solved the issue in the following way:

 

getImplementedShapes > InfoTable with all Shapes

Iterate through Shapes InfoTable and use > GetInstancePropertyDefinitions > retrieve all properties and write them to an Property InfoTable.

 

 

slangley
23-Emerald II
(To:frank247)

Hi @frank247.

 

Glad to hear you resolved your issue.  Please mark your last response as the Accepted Solution for the benefit of others with the same problem.

 

Regards.

 

--Sharon

Announcements


Top Tags