Contact Free trial Login

valuesOf

valuesOf({ (K)?: V }): Array<V>

Returns an array of the values from key-value pairs in an object.

Introduced in DataWeave 2.3.0. Supported by Mule 4.3 and later.

Parameters

Name Description

obj

The object to evaluate.

Example

This example returns the values of key-value pairs within the input object.

Source

%dw 2.0
output application/json
---
{ "valuesOf" : valuesOf({a: true, b: 1}) }

Output

{ "valuesOf" : [true,1] }

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub