Skip to main content
1-Visitor
July 11, 2019
Solved

Changing Things' Property Values From an If-Else Condition

  • July 11, 2019
  • 1 reply
  • 3863 views

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!! 🙂

Best answer by dupatel

@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

1 reply

dupatel5-Regular MemberAnswer
5-Regular Member
July 12, 2019

@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

rgomes1-VisitorAuthor
1-Visitor
July 12, 2019

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!!