Contact Free trial Login

Tour of the Transform Card (Flow Designer)

The Transform card contains numerous features to make it easy for you to map data.

The static features of the Transform card

The Transform card has four sections: Configuration, Input, Output, and Notes. The last three sections are common to all cards. While the Notes section can be very useful for explaining the work you have done in the Transform card or writing instructions to other people who might use your application as a template, you do not use the Input and Output sections in this card.

fd tour of the transform card static
Figure 1. The features of the Transform card that always appear, no matter which pane in the Configuration section is open
  1. The card’s type and name. As with other cards, you can rename the card from the default name DataWeave to any name that suits your purposes.

  2. This banner indicates whether Flow Designer has mapping suggestions for you. When it does, the banner looks like this:

    fd automapper banner true

    See "Get a Recommendation for Mapping Data Types for a Transformation" to learn when Flow Designer can make mapping suggestions for you.

  3. The Input pane shows the output from the previous card. The Transform card displays the three parts of the output: the payload, attributes, and variables. If the payload is not a simple data type, you might need to specify the data type that it uses. You might need to do the same for attributes, variables, or both.

    Supported simple data types

    Boolean, Date, DateTime, Integer, Number, String

    Other supported data types

    CSV, JSON, Object, XML

    You can specify the data type by clicking the three dots to the right of payload or vars to open the Data Type Actions menu.

    fd transform payload menu
    Figure 2. The menu for setting the data type for a payload, attributes, and variables in the Input pane

    You can create the data type that you need or select it if you created it earlier. See "Data Types" to learn more.

  4. Here you can switch between sections of the Transform card by clicking their names. (The name of the Notes section is not pictured.)

  5. Here you can switch between the panes of the Configuration section. In the image, the Mappings pane is selected and open.

  6. The Preview pane shows a preview of the output of the Transform card. Before a preview can appear, you must map the input of the Transform card to the output. When no preview is yet available, the pane looks like this:

    fd empty preview pane

The Mappings pane

This pane provides one method of mapping data. You can drag elements of the Input pane onto elements of the Output pane.

fd tour of the transform card
Figure 3. The Mappings pane in the Configuration section of the Transform card
  1. The Output pane displays the elements that will be in the payload of the output of the Transform card and passed to the next card in the flow. Flow Designer usually populates this pane by detecting the data structure that is required by the next card in the flow.

    If any of the elements in the output require data that they cannot acquire by being mapped to an element of the input, you can specify that data with a string, a number, or a DataWeave expression. Double-click the element to open this small dialog for editing the element’s value:

    fd output expression dialog
    Figure 4. The dialog that is opened when you double-click an element of the output

    By default, the value is null. You can specify the value you want by typing directly in the dialog.

    fd output expression dialog number
    Figure 5. Changing the value to a telephone number

    After you click OK, both the f(x) symbol and a trash-can icon appear to the left of the element. The f(x) symbol indicates that the value is set manually to a string, number, or DataWeave expression. Clicking the trash-can icon removes the value, but it does not remove the element.

    fd output expression dialog fx

    If the Flow Designer is unable to detect the data structure that is required by the next card in the flow, the Output pane looks like this:

    fd output pane empty
    Figure 6. The Output pane when Flow Designer cannot detect the required data type for the card that comes after the Transform card

    You can create or specify the data type to use for the payload.

  2. This area shows which elements of the input to the Transform card are mapped to which elements of the output. To map elements together, you can click an element of the input and drag it to an element of the output. An alternative is to create a DataWeave script that maps elements. You can do this in the Script pane.

The Script pane

As you map on the Mappings pane, the Transform card generates the corresponding DataWeave script in this pane. If you know DataWeave scripts, you can customize the mapping. You could even skip using the Mappings pane and write your own DataWeave script instead. To learn about DataWeave, see "DataWeave Language".

fd tour of the transform card script
Figure 7. The Script pane in the Configuration section of the Transform card

The Sample Data pane

When the following three conditions are true, you can use this pane to provide an example usage of the data type that is used for the output of the previous card:

  • You want to see a preview of the output of the Transform card.

  • The data type used for the output of the previous card is not a simple type. The simple types are string, number, integer, boolean, date, and dateTime.

  • The data type used for the output of the previous card was defined with a schema, not an example.

fd tour of the transform card sample
Figure 8. The Sample data pane in the Configuration section of the Transfrom card

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.