---
schema_version: "1"
id: 2e72ba99d11e967edaa9f20ecdb72c63d54a8b4f09b35db4dd50566c95b39d12
title: Add Another Output to the Transform Message Component (Anypoint Studio)
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mule-runtime/4.4/transform-add-another-output-transform-studio-task.md
canonical_url: https://docs.mulesoft.com/mule-runtime/4.4/transform-add-another-output-transform-studio-task
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 0264a54de0f2dce1b7ecfb097fc89054bdb6f2d0f25e3f7e2608970f012cecb8
description: MuleSoft Documentation Site
release: "4.4"
latest: false
---
---
product: Mule Runtime
version: 4.4
---

# Add Another Output to the Transform Message Component (Anypoint Studio)

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

A single Transform Message component can give shape to several different parts of the output Mule
event (the payload, variables, and attributes). Each different output part must be defined in a
separate target XML element inside the `<ee:transform>` XML element as another block of DataWeave
code. In Anypoint Studio 7, you do this by writing the DataWeave code in a separate tab of the
Transform pane. For example, if one tab defines the payload, and another attributes, these are both
parts of the same output Mule event.

To add a new output target:

1.  Click **Add new target**.

    ![using dataweave in studio 34a3e](/mulesoft/current/en-us/mule-runtime/4.4/_images/using-dataweave-in-studio-34a3e.png)

2.  Specify where in the output Mule message to place the result of this new DataWeave transform. In
    case you’re creating a new variable or property, you must also set a name for it.

    ![new variable](/mulesoft/current/en-us/mule-runtime/4.4/_images/dw-new-variable.png)

Note that the execution order of multiple outputs can vary. Ensure that each transformation is
independent of the order of execution and the other outputs.

## How Targets of a Transform Message Component are Represented in the Configuration XML File

The payload is represented in an `<ee:message>` element, as a child element of the `<ee:message>`
element.

```xml
<ee:transform doc:name="Set Transactions XML" doc:id="5c58d889-896d-495a-b2f6-fe1613ae8044" >
  <ee:message >
    <ee:set-payload ><![CDATA[%dw 2.0
                              output application/xml
                              ...]]>
```

Attributes are represented together inside the `<ee:message>` element, as a child of the
`<ee:message>` element.

```xml
<ee:transform doc:name="Set Transactions XML">
  <ee:message >
    <ee:set-payload ><![CDATA[%dw 2.0
                              output application/xml
                              ...]]>
    </ee:set-payload/>

    <ee:set-attributes>
    <![CDATA[%dw 2.0
             output application/java
             ---
            { }]]>
    </ee:set-attributes>
  </ee:message>
  ...
</ee:transform>
```

Each variable is represented inside a separate `<ee:variable>` element, as a child the
`<ee:variables>` parent element. The `<ee:variables>` element is a direct child of the
`<ee:transform>` element, so it is not part of the `<ee:message>` element. This XML structure
reflects that variables and the message are carried along together with the parent event object.

Here is an example of a variable target defined inside a Transform Message component:

```xml
<ee:transform doc:name="Set accounts var" doc:id="15e226ab-8204-4d84-ab4b-f4fcdd088656">
  <ee:message>
  ...
  </ee:message>
  <ee:variables>
    <ee:set-variable variableName="accounts">
      <![CDATA[%dw 2.0
               output application/json
               ---
               ...]]>
    </ee:variable>
  </ee:variables>
</ee:transform>
```

## See Also

[Transform Message Component](https://docs.mulesoft.com/mule-runtime/4.4/transform-component-about)

[Change the Target Output of a Transformation](https://docs.mulesoft.com/mule-runtime/4.4/transform-change-target-output-transformation-studio-task)

[Mule Message Structure](https://docs.mulesoft.com/mule-runtime/4.4/about-mule-message)

[DataWeave Language](https://docs.mulesoft.com/mule-runtime/4.4/dataweave)
