Contact Us 1-800-596-4880

Map Object Elements as an Array

This DataWeave example uses the DataWeave map function to iterate through the object elements that match the key book. The input also includes the key magazine, which is ignored.

The example uses these DataWeave functions:

  • The multi-value selector *book to return an array with the elements that match the key "book".

  • map to go through each object in the array that’s returned by the multi-value selector.

DataWeave Script:
Output JSON: