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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Change media sourceURL based on thing property

jonasf
10-Marble

Change media sourceURL based on thing property

Hello,

 

I want to change the sourceURL based on a thing property.
Currently I have an expression (see below) that has the input of a thing.getpropertyvalues and the output of a string connected to the media sourceURL property. Please see pictures below. 

 

I have verified that the input property is accessible and changes (0 or 1).

Using: ThingWorx 8.4.2-b2151

 

switch (URL) {
case 1:
return "/Thingworx/MediaEntities/GridLeft";
break;
case 0:
return "/Thingworx/MediaEntities/GridRight";
break;
}image.pngimage.png

 

 

1 REPLY 1

Hello,

 

Try it like this:

switch (URL) {
  case 1:
    result = "/Thingworx/MediaEntities/GridLeft";
    break;
  case 0:
    result = "/Thingworx/MediaEntities/GridRight";
    break;
}

 

/ Constantine

Top Tags