CompanionCompanion
Companion for Delivery
Companion for Business
Companion for Integration
Contact us
Log out
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

serializeContextValuesToJSON

The serializeContextValuesToJSON function is used to serialize context-dependent attribute values to a JSON object.

Warning : Only use this function on XML files produced with Post Processor "Copy Context Dependent Values and References".

Syntax

c4i:serializeContextValuesToJSON(xpath [, displayMultiContextValues], [, lov] [, units] [, values] [, attributeGroupFilter] [, keyMetaAttribute])

Parameters

xpath

XPath to the "Values" or "MetaData" XML node will treat all attribute values.

Otherwise, you can filter the desired values by providing a custom xPath.

displayMultiContextValues (optional)

  • Indicates if values should be indexed by context, then by attribute ID, or the other way around
  • The authorized values are "BY_CONTEXT" (default) or "BY_ATTRIBUTE"

lov (optional)

  • Indicates how to represent LOV values
  • The authorized values are "DISPLAY_LOV_VALUE_LABEL" (default), "DISPLAY_LOV_VALUE_ID" or "DISPLAY_BOTH"

units (optional)

  • Indicates how to represent units
  • The authorized values are "NO_UNITS" (default), "DISPLAY_UNIT_ID", "DISPLAY_UNIT_LABEL"

values (optional)

  • Indicates if values and units should be concatenated or separated
  • The authorized values are "CONCAT_VALUE_UNIT" (default) or "ISOLATE_VALUE"

attributeGroupFilter (optional)

  • This parameter is used to filter the attribute types depending on their attribute group
  • Can be a regex
  • Attribute group resolution is recursive

keyMetaAttribute (optional)

  • By default, attributes are indexed using their attribute ID
  • If this parameter is supplied, attributes will be indexed using a meta-attribute value, if it is present

Return value

A JSON document containing the attribute values.

Jsdoc

The return type to use in scripts is MultiContextValues.

When using parameter values = "ISOLATE_VALUE", the values of the returned structures will be of type UnitValue.

When using parameter lov = "DISPLAY_BOTH", the values corresponding to LOV based attributes with value-IDs will be of type LovSingleValue.

Last Updated: 4/13/26, 10:42 AM
Prev
serializeContextReferencesToJSON
Next
serializeDataContainerToJSON