QuestionQ55

VerifiedTransform and format data with DataWeave

Refer to the exhibits.

Northern Trail Outfitters is developing a Mule application that processes web-client POST requests with payloads containing order information, including the user name and purchased items. The Shipping connector returns a shipping address for the input payload’s user name. The Shipping connector’s Shipping Address operation is configured with a target named shippingAddress.

The Set Payload transformer must set an items key equal to the items value from the original received payload and a shippingInfo key equal to the Shipping Address operation’s response.

What is a straightforward way to properly configure the Set Payload transformer with the required data?

Input payload:

Question Image

Flow:

Question Image

Question Image

Explanation

A Mule operation configured with a target stores its output in the named flow variable and passes the same input message to the next component. The original order payload is therefore available as payload, making the items value payload.items; the Shipping Address response is available as vars.shippingAddress.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!