entriesOf<T <: Object>(obj: T): Array<{| key: Key, value: Any, attributes: Object |}>

Returns an array of key-value pairs that describe the key, value, and any attributes in the input object.

Introduced in DataWeave version 2.3.0.


Name Description


The object to describe.


This example returns the key, value, and attributes from the object specified in the variable myVar. The object is the XML input to the read function.


%dw 2.0
var myVar = read('<xml attr="x"><a>true</a><b>1</b></xml>', 'application/xml')
output application/json
{ "entriesOf" : entriesOf(myVar) }


  "entriesOf": [
       "key": "xml",
       "value": {
         "a": "true",
         "b": "1"
       "attributes": {
         "attr": "x"

entriesOf(obj: Null): Null

Helper function that enables entriesOf to work with a null value.

Introduced in DataWeave version 2.4.0.

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub
Submit your feedback!
Share your thoughts to help us build the best documentation experience for you!
Take our latest survey!