# Transformer

**Transformer** is a powerful task that provides a set of conversion and transformation functionalities.

## Encoding to XML or CSV

Data is being sent between tasks in JSON format, but it is a very common use case to convert them to CSV or XML, for example, before sending them to someone as a report via Email or using them as an input for API endpoints.

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FpMQwXVxvUKqbihj5PYmt%2FScreenshot%202022-10-01%20at%2018.52.22.png?alt=media&#x26;token=5eee3e1c-c41f-445f-a141-19ced366c058" alt=""><figcaption></figcaption></figure>

## Casting to integer or string

Sometimes, when you aggregate some data it returns the result in a certain data format, but before sending it somewhere else, it is often necessary to convert it either to a string or to an integer.

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FmzK9CveH7M8hPUsLSSqR%2FScreenshot%202022-10-01%20at%2018.55.12.png?alt=media&#x26;token=a7809850-e7d7-4023-b3fb-45f5b9f9645d" alt=""><figcaption></figcaption></figure>

## Splitting a string into an array

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FJdDxD8bpRQ61wVkDrnZj%2FScreenshot%202022-10-01%20at%2018.58.01.png?alt=media&#x26;token=7b9fac58-0641-4b18-9eb2-1d8f3f6cd336" alt=""><figcaption></figcaption></figure>

## Extracting and filtering data with GJSON

The secret sauce of our transformers is the integration with **GJSON** library that allows you to extract and filter any data from your dataset. More information about its syntax can be found in [their documentation](https://github.com/tidwall/gjson).

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FTQzaJUvu93ZzXweT6PLp%2FScreenshot%202022-10-01%20at%2019.01.03.png?alt=media&#x26;token=4547f069-252e-4217-b6d5-eb6106cf10f0" alt=""><figcaption></figcaption></figure>
