Contact Us 1-800-596-4880

Preview the Output of a Transformation (Design Center)

You can provide sample input data to your Transform component to see how the transformation affects it. You don’t need to run your application to use this feature. A sample output is updated in real time as you make changes both to the sample input and the transformation.

  1. On the input pane, select one of the parts of the input (the Payload, Attributes or a specific Variable).

  2. At the bottom of the window, select the Edit Sample Data icon preview transformation output design center 1a65a.

  3. The Sample Data tab opens and is populated.

    • If you defined your Data Type through a sample, these same values are used.

    • If you defined your Data Type through a schema or it was automatically defined, values are populated with the string ???? as a placeholder.

      Note that when the input is of type POJO (Plain Old Java Object), samples must be written in DataWeave format. This is not a transformation in itself, just a way to express how data is structured.

Example data in DataWeave format:

[
  {
      message @(id: "FSD-483"): "Hello World!",
      date: |2017-05-06|,
      items: {
          item1: 434,
          item2: "344222"
      }
  },
  {
      message @(id: "DSF-829"): "This is what DataWeave format looks like.",
      date: |2017-03-21|,
      items: {
          item1: 728,
          item2: "14422"
      }
  }
]
  1. Replace these placeholder values with different values.

    As you make changes in the sample data or the transformation, notice how the output preview changes.

    Note that if your transformer has multiple outputs (for example, to both the payload and a variable), the Preview pane displays the one corresponding to the currently selected transformation.

When the output is of type POJO (Plain Old Java Object), the preview is represented in JSON format.

  1. Test your transformation for any special characters or structures that might arrive, verify that the output is what you expected.

Note that samples defined in this pane work only within the Transform component. These samples do not affect any other components in your application.