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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Change property value from service (javascript)

binaryPUNCH
4-Participant

Change property value from service (javascript)

Hi. Can I please see a simple example on how to change the value of a property from a javascript service? A property on the same thing the service is running on. I'm struggling a little on figuring this out and finding the proper documentation.

 

I can get the property object through the Things["TestThing"].GetPropertyDefinition() function but what then? How do I know the name of the thing that invoked the service? Must it be an input parameter :(

 

2 REPLIES 2

Hi,

 

A service is called from a Thing, so if you want to change the value of a property just use:

 

var my_value="test";

me.property_name=my_value;

 

Instead of me, you can use the name of any Thing you want.

 

Best regards,

Raluca Edu

@binaryPUNCH 

Have you found a solution to your problem?  If so, please indicate the appropriate response as the Accepted Solution for the benefit of other Community members who have the same question.

 

-Vibhuti

Top Tags