Skip to main content
13-Aquamarine
June 23, 2021
Question

Can localization be used in a Mashup Expression?

  • June 23, 2021
  • 1 reply
  • 1510 views

I often use the Expression function in mashups to display a modified version of a property of a Thing. 

For instance:

 

output = DeviceName + " Description"; //DeviceName is a String Parameter

 

 

I am trying to add localization to my mashups and would like to be able to use a token for the " Description" text.  How can I do this?.

1 reply

15-Moonstone
June 24, 2021

@Timo697 You can try defining a session parameter with a default value as 'Description' and then that variable will be accessible in the mashups in the Session tab where you can bind it to your expression's input parameter.

Timo69713-AquamarineAuthor
13-Aquamarine
June 24, 2021

What would I set the Base Type as?

 

I set it to String then wrote a localization token into the Default Value:    [[Test_Description]]

 

My code in the expression is now:

output = Device + " " + Description;

 

Now, the expression has an output of:    Device [[Test_Description]]