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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

How to get parameter value from embedded thing?

bmitioglov
1-Newbie

How to get parameter value from embedded thing?

Hi guys,

I have a thing that have another several things as it's parameters with type: THINGNAME.

And I want to get values from those things in my service.

I tried to do (FireSensor1 has the number property called 'value'):

result = Things[me.FireSensor1].value

It is not working, the error is:

TypeError: Cannot read property "value" from null


Could you please explain how to do such things?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

Sorry, It was my fault. I was saving the Thing template from which my thing was inherited and FireSensor1 property was clearing because of that, so I kept getting this null pointer exception.


result = Things[me.FireSensor1].value 

This is working now.

Thanks.

View solution in original post

2 REPLIES 2

Tried also:

result = Things[me.FireSensor1.GetIdentifier()].value

Result:

TypeError: Cannot find function GetIdentifier in object FireSensor-1. (testGetValueFromSensor#9)

Sorry, It was my fault. I was saving the Thing template from which my thing was inherited and FireSensor1 property was clearing because of that, so I kept getting this null pointer exception.


result = Things[me.FireSensor1].value 

This is working now.

Thanks.

Top Tags