Skip to main content

object-values

Syntax

- object-values

Description

The object-values operation takes an object value and emits an array of its values. If the incoming value is already an array, it is emitted unchanged. For any other value type (numbers, strings, null), the value is passed through unchanged.

A common use is to convert an object whose entries are tracked by key — for example a conditions table indexed by code — into an array that can be fed into operations like reject or map. The example below extracts the list of currently active condition codes from a declared condition-type identifier.

Examples

  active-codes:
- source: system
- object-values
- reject:
expression: this.level != 'FAULT' and this.level != 'WARNING'
- map:
- expression: this.code
info

In the above example, system is a declared identifier of type condition. Its value is an object keyed by condition code, with each entry holding the latest level, code, and message for that code. The variable active-codes emits an array of the codes that are currently in FAULT or WARNING state.