Skip to main content
Jul 11, 2019 8:56 PM UTC
Solved

Changing Things' Property Values From an If-Else Condition

Hello, everyone!

 

This question is quite simple:

From an AR experience (Vuforia), I want to change a Thing property (in Thingworx) only if a condition is attended. The problem is I have no idea about how the syntax is.

 

For example:

 

In Vuforia Studio > Home.js: 

 

if(waterTemperature == 50)

{

...

[change a thing property from false to true];

...

}

 

I assume it would be something like "$scope.thing[ThingName].propertyvalue = true", right?

 

Thanks!! 🙂

dupatelAnswer
Jul 12, 2019 9:33 AM UTC

@rgomes  You a Car1 thing example having property CarOn you can use the JS code as -

$scope.app.mdl['Car1'].properties['CarOn'] == "Some Value or logic"

 

Please refer to attachment. Also as an easy way to get required detail, you can bind the  ThingWorx entity using external data in Studio to an input text of widget then refer to Binding Expression for details.

 

-Durgesh

6 replies

dupatelAnswer
Jul 12, 2019 9:33 AM UTC

@rgomes  You a Car1 thing example having property CarOn you can use the JS code as -

$scope.app.mdl['Car1'].properties['CarOn'] == "Some Value or logic"

 

Please refer to attachment. Also as an easy way to get required detail, you can bind the  ThingWorx entity using external data in Studio to an input text of widget then refer to Binding Expression for details.

 

-Durgesh

rgomesAuthor
Jul 12, 2019 1:19 PM UTC

Wow, how haven't I seen it on the binding details as you've shown?? Smiley Indifferent I'm still a newbie, after all!

 

Thanks, @dupatel!!