Mapping Task

Reshaping Context Data for Enhanced Automation

In complex automation workflows, data often originates from various sources, such as user inputs, third-party APIs, or manually enriched data. However, different systems or APIs may require data in specific structures or formats. This is where the Mapping Task in the Liberate platform proves invaluable.

By using the Mapping Task, developers can reshape the structure of context data, transforming it into a format that matches the requirements of downstream systems or APIs. This ability to tailor the data format allows for seamless integration and smooth data flow across the automation pipeline.

Benefits of reshaping context data include:

  • Data Consistency: The Mapping Task ensures that data from multiple sources is standardized and presented consistently to downstream systems, eliminating compatibility issues and data inconsistencies.
  • Efficient Integration: Reshaping context data simplifies integration with external systems or APIs by providing data in the expected format, reducing the need for additional data transformations or adaptations in downstream processes.
  • Improved Automation Accuracy: By transforming data into the required structure, the Mapping Task enables accurate processing and interpretation of data, facilitating reliable decision-making and reducing the risk of errors or misunderstandings.

Use cases for reshaping context data include:

  • Data Harmonization: When data is obtained from diverse sources with varying structures, the Mapping Task can harmonize the data, bringing it into a unified format for downstream processing.
  • System Integration: The Mapping Task is especially useful when integrating with external systems or APIs that have specific data format requirements. It ensures seamless data exchange by transforming the context data into the desired format.
  • Data Enrichment: By reshaping context data, developers can enrich or enhance the data by combining, modifying, or extracting relevant information from different sources, enabling more comprehensive and valuable automation outcomes.

Using the Mapping Task

To use the Mapping Task effectively, follow these steps:

  1. Sample Context Data: Provide a representative sample of the context data that is available within your automation. This data should include the relevant variables, properties, or fields you want to transform.
  2. JSONata Data Transformation: Write a JSONata expression in the JSONata Data Transformation panel to perform the desired reshaping of the data. Within the expression, you can access the data from the sample context data and apply various transformations, manipulations, or conditions to achieve the desired output.
  3. Updated Output/Transformation: The Updated Output/Transformation panel shows the transformed data based on the JSONata expression. It provides a visual representation of how the data will be structured after the transformation, helping you ensure that it matches the expected format for subsequent tasks or systems.

Example Mapping Task
Here's an example of how you can use the Mapping Task in the Liberate platform:

Sample Context Data:

{
    "heap": "",
    "session": {
        "hub-radio": "file_a_claim",
        "property-fnol-lob-options": "home",
        "property-fnol-reporting-party-options": "cynthia",
        "property-fnol-date-picker": "2023-04-18T07:00:00.000Z",
        ...
    }
}

JSONata Data Transformation:

{
    "claim": {
        "lob": "$.session.`property-fnol-lob-options`",
        "contact_email": "$.session.`property-fnol-contact-email`",
        "ale_radio": "$.session.`ale-radio`",
        ...
    }
}

Updated Output/Transformation:

{
    "heap": "",
    "session": {
        "hub-radio": "file_a_claim",
        "property-fnol-lob-options": "home",
        "property-fnol-reporting-party-options": "cynthia",
        "property-fnol-date-picker": "2023-04-18T07:00:00.000Z",
        ...
    },
    "claim": {
        "lob": "home",
        "contact_email": "[email protected]",
        "ale_radio": "no",
        ...
    }
}