unitOfMeasures
Last modified by Frank Hilleringhaus on 31.01.2023, 08:18
This page contains code examples for units of measures in feed/export.
Iterator
<#list unitOfMeasures as unitOfMeasureKey, unitOfMeasure>
${unitOfMeasureKey}
</#list>
${unitOfMeasureKey}
</#list>
Example result
DD
PR
KTM
HP
PX
MTR
MTS
077
110
078
035
MLT
OHM
039
WTT
...
PR
KTM
HP
PX
MTR
MTS
077
110
078
035
MLT
OHM
039
WTT
...
All Fields (in JSON Format)
{
"unitOfMeasures" :
<#list unitOfMeasures as unitOfMeasureKey, unitOfMeasure>
{
"UOMID" : "${(unitOfMeasure.UOMID!)}",
"symbol" : "${(unitOfMeasure.symbol!)}",
"translations" :
{
<#list unitOfMeasure.translations! as translation>
"${translation.languageId!}" : "${translation.description!}",
</#list>
}
}
</#list>
}
"unitOfMeasures" :
<#list unitOfMeasures as unitOfMeasureKey, unitOfMeasure>
{
"UOMID" : "${(unitOfMeasure.UOMID!)}",
"symbol" : "${(unitOfMeasure.symbol!)}",
"translations" :
{
<#list unitOfMeasure.translations! as translation>
"${translation.languageId!}" : "${translation.description!}",
</#list>
}
}
</#list>
}
Example Result
UoM for an Attribute
<#function getUoMId attributeId>
<#assign tx = typeExtensions[attributeId]!/>
<#assign uomId = ""/>
<#if tx?has_content>
<#assign uomId = tx.unitOfMeasureId!""/>
</#if>
<#return uomId>
</#function>
<#assign tx = typeExtensions[attributeId]!/>
<#assign uomId = ""/>
<#if tx?has_content>
<#assign uomId = tx.unitOfMeasureId!""/>
</#if>
<#return uomId>
</#function>
Usage
<#list attributes as attrKey, attribute>
<UnitOfMeasure id="${getUoMId(attrKey)}"/>
...