Articles in this section

Transformation 1.0

Transformation 1.0 rules help you transform extensive export or import JSON data into more manageable JSON structures that are readable and easier to understand. You can use this feature to:

  • flatten complex JSON structures.

  • provide meaningful field names.

  • remove all but a limited set of fields for processing in a flow.

You can toggle between transformation options; however, in most cases, saving settings in one transformation option will override those in the others. For example, any changes made to JavaScript will erase everything in 1.0 rules.

Notice

If the field names in your export data differ from the field names required by your destination app, you could apply a transform to the data exported from your source application that would rename those fields before sending the data to the import.

Important

In Transformation 1.0, you must extract all the fields you want to keep, even if you only modify one. Only the fields listed in the Output section of the AFE will be included in the final record.

Transformation 1.0, 2.0, or JavaScript

There are four distinct ways to transform data in integrator.io. Here are the pros and cons of each:

19326911209243-rules toggle.png

Rules toggle

  1. Rules 1.0 Engine (Transformation 1.0): This is the original transformation method.

    • Pros: It is a familiar method for those who have been using integrator.io for a long time.

    • Cons: It lacks the advanced functionality and ease of use of the newer Rules 2.0 Engine.

  2. Rules 2.0 Engine (Transformation 2.0): This is the updated transformation method. It allows for complex transformations and is more user-friendly.

    • Pros: It offers much deeper functionality than the Rules 1.0 Engine, including the ability to process any level of nested arrays. It supports JSON Path for selecting source record fields. It supports handlebar expressions for referencing custom settings fields and building custom field values using formulas. It also supports three different modes based on your use case:

      • make targeted changes to the input record

      • create an output record from the input

      • create output rows from the input

    • Cons: It may require some learning for those who are used to the Rules 1.0 Engine.

  3. JavaScript: If you're proficient with JavaScript, this method allows you to take over the transformation process completely in your code.

    • Pros: It provides full control over the transformation process and is ideal for developers who prefer coding.

    • Cons: It requires knowledge of JavaScript and may not be suitable if you're not familiar with coding.

  4. JavaScript preSavePage hooks: This method (​​hook.svg​​) allows you to work with larger data structures and perform complex operations.

    • Pros: It allows you to work with larger data structures and perform operations such as merging records, deleting records, creating more records within the page, and sorting data.

    • Cons: It requires knowledge of JavaScript and may be more complex to use than the other methods. It also requires comfort with working with larger data structures.

Apply a transform

Use the following steps to apply a transform to a flow step.

Important

You must extract all of the fields you want to keep, even if you only modify one of them. Only the fields listed under in the Output section of the AFE will be included in the final record.

  1. In Flow Builder, click + and select the transform icon. The Define transformation advanced field editor (AFE) opens.

    SpaceX_export_with_transformation_descsription.png

    Transformations in an export

    transformations_in_an_import.png

    Transformations in an import

  2. Toggle between Transformation 1.0 and JavaScript.

  3. Add your transformations.

  4. When your data meets the requirements for the next step in your flow, click Save & close.

Note

If Auto preview is enabled, the results of your transform configuration immediately display in the Output section of the AFE.