QuestionQ18

VerifiedTransform and format data with DataWeave

Refer to the exhibits.

The Set Payload transformer in the addItem child flow uses DataWeave to build an Order object. What is the correct DataWeave code for the Set Payload transformer in the createOrder flow to use the addItem child flow to add a router cable priced at 100 to the order?

Question Image

Explanation

The DataWeave lookup function executes a named flow and passes its second argument as the called flow’s payload. Because the child flow selects payload.item, payload.itemType, and payload.price, the input must be the direct object containing item: "router", itemType: "cable", and price: "100"; it must not be nested inside another payload property. MuleSoft lookup documentation

Learn more

Community Discussion

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