This is a transformation using concept of Content Enricher Pattern:

Below example take 2 payloads that stored in 2 variables (input1, input2).
input1 is payload send from source system.
input2 is payload externally get from external system via API call.

input1 contain Orders and Items. Items contain ProductID but without UnitPrice.
input2 contain Products with ProductID and UnitPrice.
Below code filter input2 based on ProductID, then get UnitPrice for corresponding ProductID of input1.


input1:


input2:


Merged output: Now payload is enriched with UnitPrice.

DataWeave – Merge 2 Payloads using map and filter
Tagged on:                     

Leave a Reply

Your email address will not be published. Required fields are marked *