# Data Transformation

While **Data Mapping** focuses on linking inbound and outbound parameters between components, **Data Transformation** extends this capability by allowing data to be **modified, calculated, or reshaped** during the mapping process.

In ONEWEB, data transformation can be applied **directly on the mapping connection**, enabling developers to adjust values, apply formulas, or construct expressions **before data is passed to the target component**.

This approach keeps transformation logic **close to the data flow** and avoids unnecessary custom code for simple conversions.

***

### Data Transformation vs Data Mapping

* **Data Mapping** defines *where* data flows
* **Data Transformation** defines *how* data is modified while flowing

Data Transformation is used when a value **cannot be passed directly** and must be adapted to meet the target contract, such as format differences, calculation requirements, or structural mismatch between systems.

***

### Accessing the Formula Editor

Data Transformation in ONEWEB is implemented through the **Formula Editor**, which is accessed directly from the mapping interface.

To apply transformation logic:

* A mapping is created between a source parameter and a target parameter
* The mapping connection (blue line) is edited
* The **Formula Editor panel** opens

The Formula Editor ensures that transformation logic remains **contextual and traceable**, directly associated with the mapped data.

<figure><img src="/files/guCNuPjZ6Uil7XLCx5U8" alt=""><figcaption></figcaption></figure>

***

### Formula Editor Capabilities

The **Formula Editor** allows developers to construct transformation expressions visually, including:

* Dragging process or Microflow parameters into expressions
* Applying mathematical operators
* Using string manipulation functions
* Combining multiple inputs into a single output expression

Transformation logic defined in the Formula Editor is evaluated during Microflow execution and applied before values reach the target parameter.

<figure><img src="/files/wEsYLrlpMD8SG15wA0Oz" alt=""><figcaption></figcaption></figure>

***

### Common Data Transformation Scenarios

Data Transformation is commonly applied in scenarios such as:

* Formatting string values (e.g. concatenation, trimming, case conversion)
* Applying arithmetic calculations
* Constructing composite values from multiple parameters
* Converting data shapes between heterogeneous systems
* Normalizing values before persistence or service invocation

These transformations enable systems with **different data contracts** to interoperate cleanly and predictably.

***

### Best Practices for Data Transformation

To maintain clarity and reliability in Microflow design:

* Keep transformation expressions **simple and readable**
* Avoid embedding complex business rules in formulas
* Use **Microflows or Java Nodes** for advanced or multi‑step transformations
* Use meaningful parameter names to reflect transformed intent
* Validate transformation outputs during testing

Well‑designed transformations improve integration robustness while keeping Microflows easy to understand and maintain.

***

### Summary

**Data Transformation** in ONEWEB allows values to be modified inline during parameter mapping using a **visual, formula‑based approach**.

With Data Transformation, developers can:

* Apply calculations and string operations during mapping
* Adapt data between different system contracts
* Keep transformation logic close to data flow
* Reduce reliance on custom code for simple conversions

Together, **Data Mapping** and **Data Transformation** form a complete visual integration model, enabling flexible, readable, and maintainable data flow within **Microflow Designer** and across ONEWEB applications.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onewebstack.com/oneweb-platform-th/designer-reference/microflow-designer/data-transformation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
