Nav

To Change the Target Output of a Transformation (Design Center)

By default, the Transform component outputs to the payload in the Mule message object. You can change the target of the transformation to another part of the output: a variable or the attributes.

In case you’re using DataWeave through the Map button, the target can’t be changed. It points to the field you are editing.

Change the Target to the Message Attributes

  1. Click on the title of the output section, which should say Output Payload by default.

  2. Select Add transformation.

  3. In the dropdown menu select attributes.

  4. Set a name for your attribute.

This action opens a new transformation that outputs to the new target. The graphical, script, and preview view will correspond to the new transformation.

If you want to remove the default transformation that outputs to the Payload:

  1. Click on the title of the output section, which should say Attributes.

  2. Click the Trash Can icon next to the Payload.

Change the Target to a Variable

  1. Click on the title of the output section, which should say Output Payload by default.

  2. Select Add transformation.

    • In the dropdown menu select variable.

      to transform data a8f15

  3. Set a name for your variable.

    to transform data ea406

This action opens a new transformation that outputs to the new target. The graphical, script, and preview view will correspond to the new transformation.

If you want to remove the default transformation that outputs to the Payload:

  1. Click on the title of the output section, which should say Variable - and the name of your variable.

  2. Click the Trash Can icon next to the Payload.