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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Change media sourceURL based on thing property

jonasf
12-Amethyst

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

Announcements


Top Tags