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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Change property value from service (javascript)

binaryPUNCH
12-Amethyst

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

Announcements


Top Tags