# 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="/files/OOv8y3heyuZMmnQyk5lF" 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="/files/dPpGrrfaTNOl0c1u0vsk" alt=""><figcaption></figcaption></figure>

## Splitting a string into an array

<figure><img src="/files/PmK2rlKDlSfsBzHQBlog" 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="/files/yFXZkMFIEs16JJKLNBzt" alt=""><figcaption></figcaption></figure>


---

# 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.ylem.co/pipelines/tasks-ip/transformers.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.
