Skip to main content
1-Visitor
August 12, 2016
Solved

How to get property value from InfoTable

  • August 12, 2016
  • 1 reply
  • 3389 views

I am writing a simple service to obtain a property, (Temperature, Humidity..etc) from a Thing. I have an InfoTable listing all the Thing properties but I want to grab the numerical value of a pre-specified property. I need some help in the last line to grab the value from the infotable obtained from GetPropertyValues.

if (thingName) {

    var t = Things[thingName];

}

table = t.GetPropertyValues();

// obtain temperature value from table

// result = table.value(property);

Thanks,

Daniel

Best answer by emoreira

Hi Daniel,

Any reason why you want to use the getProperties? You can do it by doing:

result = table.YOURPROPERTYNAME;

You can also use indirect reference:

result = Things[thingName].YOURPROPERTYNAME;


Cheers

Ewerton

1 reply

emoreira14-AlexandriteAnswer
14-Alexandrite
August 12, 2016

Hi Daniel,

Any reason why you want to use the getProperties? You can do it by doing:

result = table.YOURPROPERTYNAME;

You can also use indirect reference:

result = Things[thingName].YOURPROPERTYNAME;


Cheers

Ewerton