Skip to main content
11-Garnet
December 11, 2015
Solved

How to get 'unit' value definde in property from Mashup

  • December 11, 2015
  • 1 reply
  • 2615 views

Hi experts,

I would like to use 'Unit' information defined in number property, in some widget like label, grid and so on.

How can get it in Mashup Builder?

Regars,

Kinichi

Best answer by CarlesColl

Hi Kinichi,

You need to create a service in order to get the units, the code you will have to put in that service:

String GetUnits(propertyName) {

        var values = me.GetPropertyValues();

        var prop = values.dataShape.fields[propertyName];

        var result = prop.aspects["units"];  

}

1 reply

1-Visitor
December 11, 2015

Hi Kinichi,

You need to create a service in order to get the units, the code you will have to put in that service:

String GetUnits(propertyName) {

        var values = me.GetPropertyValues();

        var prop = values.dataShape.fields[propertyName];

        var result = prop.aspects["units"];  

}

11-Garnet
December 11, 2015

Thnaks Carles,

I could get the unit information.