CompanionCompanion
Companion for Delivery
Companion for Business
Companion for Integration
Contact us
Companion for Delivery
Companion for Business
Companion for Integration
Contact us
  • Companion for Integration

    • Introduction
    • Getting Started
    • Configuration
    • Excel templating
    • How it works
  • YAML Configuration

    • Principles
    • Syntax
    • Validation
  • Custom Functions

    • Summary
    • arrayToJSON
    • bool
    • concatValueAndUnit
    • convertUnit
    • currentContextId
    • exportTime
    • eval
    • firstNonEmpty
    • getContextName
    • getEvents
    • getLastEventTime
    • getReferencesByAttributeGroup
    • getStoredValue
    • getWorkspaceId
    • hash
    • hasStoreKey
    • if
    • integer
    • join
    • mergeInheritedValues
    • multiValuesToJSON
    • number
    • nodeList
    • order
    • resolveUnitLabel
    • serializeAssetPushLocationsToJSON
    • serializeAttributeLinksToJSON
    • serializeContextReferenceToJSON
    • serializeContextReferencesToJSON
    • serializeContextValuesToJSON
    • serializeDataContainerToJSON
    • serializeDataContainersToJSON
    • serializeListOfValueValuesToJSON
    • serializeReferencesToJSON
    • serializeReferenceToJSON
    • serializeValuesToJSON
    • store
    • toXML
    • uppercase
  • Execution

    • Summary
    • Composite
    • From STEP
    • Standalone
    • Performance statistics
  • Configuration

    • ActiveMQ extension
    • Amazon AWS extension (SNS, SQS, Kinesis, S3)
    • ElasticSearch/OpenSearch extension
    • File extension (Excel, CSV, JSON, XML, JSONL, XMLL)
    • Kafka extension
    • Kafka Core extension
    • MongoDB/Cosmos DB extension
    • SQL extension
    • REST extension
    • Google Pub/Sub extension
  • c4i SaaS

    • Introduction
    • Managing jobs
    • Managing executions
    • Managing users
    • Changelog
  • Changelog

    • Core features changelog
    • ActiveMQ extension changelog
    • Amazon AWS extension changelog
    • Composite extension changelog
    • ElasticSearch extension changelog
    • File extension changelog
    • Kafka extension changelog
    • Kafka Core extension changelog
    • MongoDB/Cosmos DB extension changelog
    • SQL extension changelog
    • REST extension changelog
    • Google Pub/Sub extension changelog

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"}]
Last Updated: 7/31/23, 10:35 AM
Prev
serializeDataContainersToJSON
Next
serializeReferencesToJSON