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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

How to get the property value where Thing name and property name is dynamic

sbt
15-Moonstone
15-Moonstone

How to get the property value where Thing name and property name is dynamic

Hello Team,

I have a scenario where i need to get the property value where Thing name and property name is dynamic.

var dynThingName = "Thing1";

var dynPropName = "prop1";

result = Things[dynThingName ].dynPropName ;


Failed to get the value, dynPropName is not getting value bcoz it searches for dynPropName which is not defined.

I have used GetNamedPropertyValues but for a single property value i need to create a infotable as input parameter.


Any other ways to get the value in a simple way.


Thanks

Sunay

ACCEPTED SOLUTION

Accepted Solutions

Should be with [] --> Things[dynThingName][dynPropName]

View solution in original post

4 REPLIES 4
PaiChung
22-Sapphire I
(To:sbt)

You should be able to get it with

Things[dynThingName](dynThingProperty) or perhaps both are ( )

sbt
15-Moonstone
15-Moonstone
(To:sbt)

Hello Chung,

Tried putting ( ) across the dynamic property, but i am still get the error.

Thanks

Sunay

Should be with [] --> Things[dynThingName][dynPropName]

sbt
15-Moonstone
15-Moonstone
(To:CarlesColl)

Thanks Carles. It works

Announcements


Top Tags