serializeListOfValueValuesToJSON
The serializeListOfValueValuesToJSON
function is used to serialize all the values of List Of Values.
Syntax
c4i:serializeListOfValueValuesToJSON(xpath)
Parameters
xpath
XPath to a List of Values
Return value
A JSON document representing the List of Values. If the LOV is ID-based, the document will consist of key-values pairs where the keys will be the LOV Values IDs and the values will be the LOV Values labels. Otherwise, the document will be an array of LOV Values labels.
Example
Given the following STEP XML:
<STEP-ProductInformation>
<ListsOfValues>
<ListOfValue ID="LOV-LABELS" UseValueID="false">
<Name>LOV (Values do not use IDs)</Name>
<Validation BaseType="text" MinValue="" MaxValue="" MaxLength="100" InputMask=""/>
<Value>Value 1</Value>
<Value>Value 2</Value>
</ListOfValue>
<ListOfValue ID="LOV-IDS" UseValueID="true">
<Name>LOV (Values use IDs)</Name>
<Validation BaseType="text" MinValue="" MaxValue="" MaxLength="100" InputMask=""/>
<Value ID="1">Value 1</Value>
<Value ID="2">Value 2</Value>
</ListOfValue>
</ListsOfValues>
</STEP-ProductInformation>
The following YAML configurations will produce the following output:
c4i:serializeListOfValueValuesToJSON(.)
["Value 1", "Value 2"]
[{"1" : "Value 1"}, {"2" : "Value 2"}]