Skip to main content
Jun 23, 2021 3:19 PM UTC
Question

Can localization be used in a Mashup Expression?

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?.

2 replies

Jun 24, 2021 6:34 AM UTC

@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.

Timo697Author
Jun 24, 2021 1:14 PM UTC

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