Transforming data with the transformation generator

When mapping fields in a flow, if your source and target data formats or drop-down values do not match, you can use the transformation generator to help you construct JSONata expressions to convert your source data to the required target format.
Availability: Data transformation is available only in an instance of App Connect Designer 12.0.1.0-r1 or later.

The following transformations are supported:

  • Pattern transformation:

    Use this transformation to change the format of source data that is passed to a target application if the source and target data formats do not match. The source data might be specified as mappings from previous nodes in the flow or static text within the target text field.

    For example, if a source application requires dates to be in the format DD/MM/YYYY, but the target application requires MM/DD/YYYY, you can provide sample data of the source and target formats, and then use the transformation generator to generate a JSONata expression for the "source" mapping in the target field. Similarly, if a source application requires names to be in the format Firstname Surname and the target application requires Firstname SURNAME, the transformation generator can construct a JSONata expression by using samples that you provide.

  • Enum transformation:

    Use this transformation to define how to map source and target drop-down values that do not match, to ensure that appropriate values are passed to the target application.

    For example, if the source and target applications offer varying values for a Priority drop-down list as shown in the following table, you could choose to map the source and target values as follows: High:Urgent, Medium:Normal, and Low:Low. You can then use the transformation generator to generate a JSONata expression for the "source" mapping in the target field.

    Source application Target application
    • High
    • Medium
    • Low
    • Urgent
    • Normal
    • Low

If you are creating a flow and have applied top suggestions to auto-populate the fields for an action with mappings from previous nodes, you can manually insert mappings in the remaining fields and then apply transformations to the populated mappings as required.

Completing pattern transformations

If a text field is populated with mappings from top suggestions, or from the Suggested mappings or Available mappings list, but the data formats of the "source" mappings do not match the data format of the target field that is populated, you can generate a JSONata expression to define how to present the source data in the target application.

To transform the data format of inserted mappings, complete the steps in the version of Designer that you are using:

Completing pattern transformations in App Connect Designer 12.0.7.0-r1 or later

This information is applicable to App Connect Designer 12.0.7.0-r1 or later when a target field is populated with one or more "source" mappings from previous nodes in the flow.

You can transform the data format of a single mapping that is inserted into a target field. If the target field is populated with multiple mappings, you can also choose to transform individual mappings, or you can collectively transform the entire contents of the field. If the target field includes static data, you will need to include this data in the target examples that you provide for generating the JSONata expression.

  • To transform the data format of a single mapping in a target field that is populated with one or more mappings, complete the following steps:
    1. From the target field, click a single "source" mapping that you want to transform and then click Transform data format from the pop-up menu.
      Transform data format option in the pop-up menu
      Tip: If the target field contains a single mapping only that you want to transform, you can alternatively click within the field and then click the Transform data format link that is displayed below the field.
      Transform data format link shown below the target field

      The "Generate transformation for TargetFieldName" panel opens with five blank source and corresponding target fields that are presented as separate columns within which you can map your data formats. A Populate using sample data button is displayed above the left (source) column.

      Generate transformation panel for pattern transformation with a "Populate using sample data" button for inserting discovered data
    2. Provide examples of source and target data formats as follows:
      • To auto-populate the fields with examples that are based on data in the source and target applications for the connected accounts, click the Populate using sample data button. This action initiates a discovery for existing data in the source and target applications. If data is discovered in the source application, the fields in the left column are populated with a random sampling of unique examples from the source application. If fewer than five examples are discovered, manually specify similar examples in any source fields that are left blank.
        Generate transformation panel for pattern transformation with the fields populated by the "Populate using sample data" button

        If data is also discovered in the target application, this data is analyzed to identify the specified formats; for example, lowercase or uppercase formats. The source examples in the left column are then used to generate target examples that are based on the discovered target formats. Up to five formats can be shown within individual tabs (numbered 1 to 5) above the right (target) column. A Copy from source link is also shown below the target fields. Click each numbered tab to examine the generated target formats. If you want to accept a generated format, ensure that its numbered tab is active. If you prefer to specify a custom format, either edit the data on a numbered tab, or click the Copy from source link to add a copy of the source examples as target examples. When you begin to edit the data or when you click Copy from source, an Edited tab is appended to the existing numbered tabs, and the focus switches to this tab. The Edited tab enables you to specify a custom format, while preserving the generated formats in the numbered tabs for reselection if required. The data in the Edited tab always shows your latest update.

        Generate transformation panel for pattern transformation with a numbered tab and the Edited tab for "Copy from source"

        If no data is discovered in the target application, the fields in the right column remain blank. You can use the Copy from source link to add a copy of the source examples as target examples and then edit the copied data if required. You can also manually specify examples in a preferred format.

        Generate transformation panel for pattern transformation with a "Copy from source" link when no target data is discovered

      • If no data is discovered in the source and target applications after you click the Populate using sample data button, the source and target fields remain blank. The Copy from source link is also shown as initially disabled.
        Generate transformation panel for pattern transformation with a disabled "Copy from source" link when no source and target data is discovered

        In the left column, manually specify at least five examples for the source field. (The Copy from source link becomes enabled when you begin to add the first entry.) To complete the target fields, either click the Copy from source link to add a copy of the source examples as target examples, or manually specify examples in your preferred format.

      Tips for completing the source and target fields:
      If you need to manually specify examples:
      • Ensure that an identical data format is used for all the source field examples. Similarly ensure that an identical data format is used for all the target field examples.
      • Ensure that there is a completed example for each source/target pair of fields.
      • Ensure that each example is of the expected data type. For example, use a date format if the source and target fields are used to present dates.

      To add more examples, click Add row. You can also delete examples, but must ensure that at least five completed source/target pairs are provided in order to enable the Transform data format link.

    3. Click Transform data format to generate a JSONata expression that represents your selections.
      Generate transformation panel with a generated JSONata expression
    4. Click Insert transformation to insert the JSONata expression into the target field.
      Target field populated with generated JSONata
      Tip: After you've transformed a mapping in the target field, a Transform data format link is no longer displayed below the field if you click within that field. However, you can click individual mappings in that field and then use the Transform data format option in the resulting pop-up menu to additionally transform data if required.


  • To transform the entire contents of a target field that contains multiple mappings, complete the following steps:
    1. Click within the field and then click the Transform data format link that is displayed below the field.
      Transform data format link shown below the target field with multiple mappings

      The "Generate transformation for TargetFieldName" panel opens in a multi-column structure with a dividing line that separates the source and target formats. On the left side of the dividing line, individual columns are presented for each source mapping that the target field contains, and each column contains five blank source fields (as rows). To the right of the dividing line, a single column with five blank target fields is provided for specifying a concatenation of target formats for each of the source examples. A Populate using sample data button is also displayed above the left (source) columns.

      Generate transformation panel for pattern transformation with a "Populate using sample data" button for inserting discovered data
    2. Provide examples of source and target data formats as follows:
      • To auto-populate the fields with examples that are based on data in the source and target applications for the connected accounts, click the Populate using sample data button. This action initiates a discovery for existing data in the source and target applications. If data is discovered in the source application, the fields in the left (source) columns are populated with a random sampling of unique examples from the source application. If fewer than five examples are discovered for any column, manually specify similar examples in any source fields that are left blank.
        Generate transformation panel for pattern transformation with the fields populated by the "Populate using sample data" button

        If the appropriate type of data is also discovered in the target application, this data is analyzed to identify the specified formats; for example, lowercase, uppercase, or date formats. The source examples in the left columns are then used to generate target examples that are based on the discovered target formats. Up to five formats can be shown within individual tabs (numbered 1 to 5) above the right (target) column. A Copy from source link is also shown below the target fields. You can examine the generated target formats on each numbered tab, and either accept a format or specify a custom one. Ensure that the tab with your preferred format is active before attempting to transform the data.

        • This example illustrates how multiple discovered target formats are presented in numbered tabs.

          Generate transformation panel for pattern transformation with numbered tabs that contain discovered target formats"

          If you prefer to specify a custom format, either edit the data on one of the numbered tabs, or click the Copy from source link to add a concatenated copy of the source examples as target examples. When you begin to edit the data or when you click Copy from source, an Edited tab is appended to the existing numbered tabs, and the focus switches to this tab. The Edited tab enables you to specify a custom format, while preserving the original formats in the numbered tabs for reselection if required. The data in the Edited tab always shows your latest update.

          Generate transformation panel for pattern transformation with the Edited tab for "Copy from source"

        If the appropriate data is not discovered in the target application, the fields in the right column remain blank. You can use the Copy from source link to add a concatenated copy of the source examples in each row as target examples.

        Generate transformation panel for pattern transformation with a "Copy from source" link that is used to copy multiple source examples when no target data is discovered

        You can then edit the copied data as required. (In the following example, the @ symbol and email domain have been removed from the email addresses in the target fields, and the time has been removed from the dates.) You can also manually specify target examples without copying the source.

        Generate transformation panel for pattern transformation with edited target data

      • If no data is discovered in the source and target applications after you click the Populate using sample data button, the source and target fields remain blank. The Copy from source link is also shown as initially disabled.

        In the left columns, manually specify at least five examples for each column of source fields. (The Copy from source link becomes enabled when you begin to add the first entry.) To complete the target fields, either click the Copy from source link to add a copy of the source examples as target examples and edit as required, or manually specify examples in your preferred format.

      Tips for completing the source and target fields:
      If you need to manually specify examples:
      • Ensure that at least five examples are specified for the source fields in each (source) column.
      • Ensure that at least five examples are specified in the (target) column. If no target examples are generated, the easiest option is to use Copy from source to add a concatenated copy of the source examples in each row to the target fields, and then edit the target formats as required. Also ensure that the concatenated target examples are listed in the same sequence as the source mappings.

        If the target field in the flow editor contains any static data, include and correctly position this data in your target examples to ensure that the target field is correctly populated when you insert the transformation.

      • Ensure that an identical data format is used for all the source field examples. Similarly ensure that an identical data format is used for all the target field examples.
      • Ensure that there is a completed example for each source/target pair of fields.
      • Ensure that each example is of the expected data type. For example, use a date format if the source and target fields are used to present dates.

      To add more examples, click Add row. You can also delete examples, but must ensure that at least five completed source/target pairs are provided in order to enable the Transform data format link.

    3. Click Transform data format to generate a JSONata expression that represents your selections.
      Generate transformation panel with a generated JSONata expression
    4. Click Insert transformation to insert the JSONata expression into the target field.
      Target field populated with generated JSONata
      Tip: After you've collectively transformed the inserted mappings in the target field, a Transform data format link is no longer displayed below the field if you click within that field. However, you can click an individual mapping in the field and then use the Transform data format option in the resulting pop-up menu to additionally transform data if required.

  • This example illustrates how to transform the data in a target field that includes multiple mappings that are prefixed with some static text (in this case, Reference:). In the Generate transformation panel, the static text is added as a prefix to each of the target example formats to ensure that this text is included in the generated JSONata expression.

    Generate transformation panel with a generated JSONata expression that includes static text

Completing pattern transformations in App Connect Designer 12.0.5.0-r1-lts or later 12.0.M.0-rX-lts, and 12.0.5.0-r2 to 12.0.6.0-r1

This information is applicable to App Connect Designer 12.0.5.0-r1-lts or later 12.0.M.0-rX-lts, and 12.0.5.0-r2 to 12.0.6.0-r1 when a target field is populated with a single "source" mapping from a previous node in the flow.

To transform the data format of an inserted mapping, complete the following steps:

  1. Click the relevant "source" mapping within the target field and then click Transform data format from the pop-up menu. (If using App Connect Designer 12.0.5.0-r1-lts to 12.0.5.0-r3, click Generate transformation from the pop-up menu.)
    Transform data format menu option
    Tip: If using App Connect Designer 12.0.5.0-r4 or later, you can alternatively click within the target field that contains the mapping and then click the Transform data format link that is displayed below the field.
    Transform data format link shown below the target field

    The "Generate transformation for SourceFieldName" panel opens with five blank source and corresponding target fields that you can use for mapping data formats. When this panel opens, an attempt is made to discover data from existing records in the source and target applications, so that this data can be used to populate the source and the target fields with examples. A Populate using retrieved data link is displayed above the left (source) column if data is discovered in the source application for the connected account.

    Generate transformation panel for pattern transformation with a "Populate using retrieved data" link for inserting discovered data
  2. Provide examples of source and target data formats as follows:
    • If data is discovered in the source application (as indicated by the Populate using retrieved data link), click this link to populate the fields in the left column with a random sampling of unique examples from the source application. If fewer than five examples are discovered, manually specify similar examples in any source fields that are left blank.
      Generate transformation panel for pattern transformation with the fields populated by the "Populate using retrieved data" link

      If data is additionally discovered in the target application, this data is analyzed to identify various formats; for example, lowercase or uppercase formats. The source examples in the left column are then used to generate target examples for the discovered formats. Up to five formats can be shown within individual tabs (numbered 1 to 5) above the right (target) column. A Copy from source tab is also shown as the last tab. You can either click a numbered tab to display generated target examples for a specific format, or you can click the Copy from source tab to add a copy of the source examples as target examples. You can also edit the examples if required.

      Generate transformation panel for pattern transformation with numbered tabs and a "Copy from source" tab

      If no data is discovered in the target application, the fields in the right column remain blank, but a Copy from source link is displayed. You can click this link to add a copy of the source examples as target examples, and can edit the values as required.

      Generate transformation panel for pattern transformation with a "Copy from source" link when no target data is discovered

    • If no data is discovered in the source and target applications, a Populate using retrieved data link is not displayed. A Copy from source link is shown as initially disabled.
      Generate transformation panel for pattern transformation with a disabled "Copy from source" link when no source or target data is discovered

      In the left column, manually specify at least five examples for the source field. (The Copy from source link becomes enabled after you add the first entry.) Next click Copy from source to add a copy of the source examples as target examples, and then edit the target examples if required. If you prefer not to copy the source examples, you can instead just manually specify target examples in the preferred format.

    Tip:
    If you decide to manually specify examples:
    • Ensure that an identical data format is used for all the source field examples. Similarly ensure that an identical data format is used for all the target field examples.
    • Ensure that there is a completed example for each source/target pair of fields.
    • Ensure that each example is of the expected data type. For example, use a date format if the source and target fields are used to present dates.

    To add more examples, click Add row. You can also delete examples, but must ensure that at least five completed source/target pairs are provided in order to enable the Transform data format link (or Generate transformation link if using App Connect Designer 12.0.5.0-r1-lts to 12.0.5.0-r3).

  3. Click Transform data format to generate a JSONata expression that represents your selections. (If using App Connect Designer 12.0.5.0-r1-lts to 12.0.5.0-r3, click Generate transformation.)
    Generate transformation panel with a generated JSONata expression
  4. Click Insert transformation to insert the JSONata expression into the target field.
    Target field populated with generated JSONata

Completing pattern transformations in App Connect Designer 12.0.4.0-r2 or earlier

This information is applicable to App Connect Designer 12.0.4.0-r2 or earlier when a target field is populated with a single "source" mapping from a previous node in the flow.

To transform the data format of an inserted mapping, complete the following steps:

  1. Click the relevant "source" mapping within the target field and then click Generate transformation from the pop-up menu.
    Generate transformation menu option

    The "Generate transformation for SourceFieldName" panel opens with five blank source and corresponding target fields that you can use for mapping data formats.

    Generate transformation panel for pattern transformation
  2. In the left column, provide at least five examples for the source field by typing in values, and then add examples in the right column to show the preferred format for the target field.
    • Ensure that an identical data format (or pattern) is used for all the source field examples.
    • Ensure that an identical data format is used for all the target field examples. To complete a target example, copy and paste the corresponding source format example and then edit the format as required.
    • Ensure that there is a completed example for each source/target pair of fields.
    • Ensure that each example is of the expected data type. For example, use a date format if the source and target fields are used to present dates.
    • To add more examples, click Add row. You can also delete examples, but must ensure that at least five completed source/target pairs are provided in order to enable the Generate transformation link.
  3. Click Generate transformation to generate a JSONata expression that represents your selections.
    Generate transformation panel with JSONata expression
  4. Click Insert transformation to insert the JSONata expression into the target field.
    Target field populated with generated JSONata


Completing enum transformations

If a drop-down field is populated with a single mapping from a top suggestion or from the Suggested mappings or Available mappings list, and the drop-down list values for the inserted "source" mapping do not match the drop-down list values for the target field that is populated, the following notification is displayed under the target field:

SourceApplication has different values for SourceFieldName

A Transform data format link is also displayed. (If using App Connect Designer 12.0.5.0-r3 or earlier, a Generate transformation link is displayed.)

Transform data format link under a target field

To map the drop-down values for the source and target fields, complete the following steps:

  1. Click the Transform data format link to open the "Generate transformation for SourceFieldName" panel. (If using App Connect Designer 12.0.5.0-r3 or earlier, click the Generate transformation link.) The drop-down values for the source field are listed in left column, and the right column contains corresponding drop-down lists that are populated with target values.
    Generate transformation panel for enum transformations
  2. Use the target drop-down lists to map an appropriate target value to each source value.
  3. Click Transform data format to generate a JSONata expression that represents your selections. (If using App Connect Designer 12.0.5.0-r3 or earlier, click Generate transformation.)
    Generate transformation panel with a generated JSONata expression
  4. Click Insert transformation to insert the JSONata expression into the target field.
    Target field populated with generated JSONata



Disclaimer: You are responsible for any example data (including any personal information) used for, and any decision to proceed with, any automated flows which are suggested for your convenience when IBM® App Connect is used. IBM has no responsibility for any such automated flows and IBM warranties and support will not apply to them; they are used at your risk. IBM might periodically modify the underlying learning models in App Connect through updates, fixes, or patches in order to improve App Connect performance.