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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

How to get property value from InfoTable

dgomez
1-Visitor

How to get property value from InfoTable

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

ACCEPTED SOLUTION

Accepted Solutions
emoreira
14-Alexandrite
(To:dgomez)

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

View solution in original post

1 REPLY 1
emoreira
14-Alexandrite
(To:dgomez)

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

Announcements


Top Tags