resolveUnitLabel

The resolveUnitLabel function is used to display the label of a unit from an attribute value.

Syntax

c4i:resolveUnitLabel(unitId)

Parameters

unitId

The ID of a STEP unit

Return value

The string label of the unit

Example

Given the following STEP XML:

<STEP-ProductInformation ExportTime="2020-06-05 10:15:28" ContextID="FR" WorkspaceID="Main">
    <UnitList>
        <Unit ID="unece.unit.KTM">
            <Name>km</Name>
        </Unit>
    </UnitList>
    <AttributeList>
        <Attribute ID="ATT_001">
            <Validation BaseType="number" />
        </Attribute>
    </AttributeList>
    <Products>
        <Product UserTypeID="PROD_ARTICLE" ID="123">
            <Name>Test Product</Name>
            <Values>
                <Value AttributeID="ATT_001" UnitID="unece.unit.KTM">16</Value>
            </Values>
        </Product>
    </Products>
</STEP-ProductInformation>

The following YAML configuration will produce the following output

c4i:resolveUnitLabel(string(Values/Value[@AttributeID="ATT_001"]/@UnitID))
"km"
Last Updated: