---
title: Data and transformations
project: Flow
version: 11.1
section: components
language: en
license: MIT
url: https://totaljs.es/docs/flow/11-1/components/data-and-transformations/
updated: 2026-11-20T06:50:52.962Z
---

# Data and transformations

> Components that parse, read, template and generate data.

Components that parse, read, template and generate data. This page holds the catalogue groups **Transformations**, **Objects**, **Data**, **Array**, **Templates**, **HTML**, **Generators**, **Scripting**.

Each entry lists the inputs and outputs of the component, its main settings and the text of its readme. To add a component to a FlowStream, see [Download components](/flow/11-1/guides/download-components/).

## API

### cheerio.html · version 1

Type: `component`

Runs your code with Cheerio to read data from HTML.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `fn` | `String` | no |  | The code that reads the HTML. `$` is the Cheerio instance and `html` is the HTML string; return the result. |
| `path` | `String` | no |  | Path to html. |

**Inputs:** `input` (Input).  
**Outputs:** `output` (Output).

Flow installs the npm package `cheerio` when you add the component.

Uses [Cheerio](https://cheerio.js.org/index.html)
Please refer to the [documentation](https://cheerio.js.org/classes/Cheerio.html) for available functions.

**Input**

```js
<any>
```

**Output**

```js
{
result: <the data returned from the code>,
input: <incomming data>
}
```

**Example code**

```js
// instance : component instance
// $: cheerio instance
// html: html string

var txt = [];
$('ul > li').each(function (i, elem) {
txt.push($(this).text());
});
return txt;
```

### dataparser.html · version 1

Type: `component`

Splits a buffer or string into parts by new lines or by begin and end phrases.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `convert` | `Boolean` | no | `false` | Convert parsed value to the object. |
| `beg` | `String` | no |  | Begin phrase. |
| `end` | `String` | no |  | End phrase. |

**Inputs:** `input` (Input).  
**Outputs:** `output` (Output).

The component can parse newline data or begin/end phrases in the buffer or string. In addition, it can help with parsing XML or CSV files.

### model.html · version 3

Type: `component`

Prepares incoming data according to a schema.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `name` | `String` | no | `Model` | Model name. |
| `path` | `String` | no |  | Load data from the specific property/field. |
| `rewrite` | `Boolean` | no | `true` | Rewrite value only (otherwise, it will replace entire message data). |

**Inputs:** `input` (Data), `partial` (Partial data).  
**Outputs:** `output` (Output), `error` (Error).

This component prepares incoming data according to the defined schema. Output is prepared model or Error.

### object.html · version 1

Type: `component`

Creates an object from a Tangular template.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `template` | `String` | no |  | The Tangular template of the object. |

**Inputs:** `input` (Input).  
**Outputs:** `output` (Output).

The component creates an object from the defined string (Tangular) template. With the help of the Tangular template engine, you can use conditions, loops, etc..

__Available markup__:

- `{{ data.key }}` represents data
- `{{ variables.key }}` represents local and global Flow variables
- `{{ hostname }}` contains a current URL address to the main Flow app `{String}`
- `{{ url }}` contains a current URL address to the current Flow `{String}`
- `{{ env }}` contains a current environment `{String}`

### qrcode.html · version 1

Type: `component`

Generates a QR code.

**Inputs:** `input` (Input).  
**Outputs:** `output` (Output), `error` (Error).

Flow installs the npm package `qrcode` when you add the component.

The component generates QR Code.

__Input data__:

```js
{
	text: String
}
```

__Output data__:

```js
{
	text: String,
	data: 'Data URL - BASE64'
}
```

### read.html · version 3

Type: `component`

Reads specific values from the data according to a map.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `path` | `String` | no |  | Load data from the specific property/field. |
| `keep` | `Boolean` | no | `false` | Keep the message data and transform only specific paths. |
| `rewrite` | `String` | no |  | Rewrite value only (otherwise, it will replace entire message data). |

**Inputs:** `input` (Input).  
**Outputs:** `output` (Output).

This component reads specific values according to the configured map.

### rssreader.html · version 1

Type: `component`

Downloads every item of an RSS feed.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `url` | `String` | no |  | URL address. |
| `type` | `String` | no | `a` | Output. One of: `a` (Send all items), `b` (Send only new items), `c` (Send every item separately), `d` (Send only new items separately). |

**Inputs:** `input` (Trigger).  
**Outputs:** `output` (Output).

The component downloads every item from the RSS source. A message on to this `Trigger` input starts downloading RSS data.

__Example__:

```js
{
	title: String,
	description: String,
	link: String,
	image: String, // optional
	date: Date // optional
}
```

### script.html · version 1

Type: `component`

Runs your own JavaScript code with a simple send function.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `code` | `String` | no |  | The JavaScript code that runs for each message. |

**Inputs:** `input` (Input).  
**Outputs:** `output` (Output).

This component executes a custom JavaScript code as it is. To send data to the default output use `send(data);`

### snapshot.html · version 1

Type: `component`

Saves snapshots of incoming data to send them again later.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | `String` | no | `id` | Message ID. |
| `name` | `String` | no | `{{ data.name }}` | Snapshot name. |
| `status` | `String` | no | `Initial data` | Snapshot status. |
| `remove` | `String` | no | `1 year` | Remove snapshots older than. |

**Inputs:** `input` (Input).  
**Outputs:** `output` (Output).

The component takes a snapshot of the incoming data and the user can reuse saved snapshots in the future.

### split.html · version 1

Type: `component`

Splits an array into separate messages.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `path` | `String` | no |  | Load data from the specific property/field. |

**Inputs:** `input` (Input).  
**Outputs:** `output` (Output).

The component splits a message with an array of objects on the input into separate messages with individual objects on the output.

__Input example__:

```js
[
	{
		"email": "michal@totaljs.com",
		"date": 20220202,
		"name": "Michal Klacan"
	},
	{
		"email": "martin@totaljs.com",
		"date": 20220204,
		"name": "Martin Smola"
	},
	{
		"email": "peter@totaljs.com",
		"datum": 20220210,
		"name": "Peter Sirka"
	}
]
```

__Output example__:

```js
{
	"email": "michal@totaljs.com",
	"date": 20220202,
	"name": "Michal Klacan"
}
```

```js
{
	"email": "martin@totaljs.com",
	"date": 20220204,
	"name": "Martin Smola"
}
```

```js
{
	"email": "peter@totaljs.com",
	"datum": 20220210,
	"name": "Peter Sirka"
}
```

### tangular.html · version 1

Type: `component`

Renders a Tangular template with the incoming data.

**Inputs:** `input` (Input).  
**Outputs:** `output` (Output).

The component uses server-side implementation of [Tangular template engine](https://docs.totaljs.com/components/40d06002lm50c/).

**Example**

__Incomming data__:

```js
{
	app_name: 'Total.js Flow'
}
```

__Template__:

```html
App name: {{ value.app_name }}
```

- `$` type `{MessageInstance}` <https://docs.totaljs.com/total4/40844001ni51c/>

In the example bellow, the $.refs.controller is only available if the message was created by the Route component:

```html
URL: {{ $.refs.controller.url }}
```

### vs.html · version 1

Type: `component`

Generates a variable symbol in a custom format.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `format` | `String` | no | `yyyy####` | Format. |
| `path` | `String` | no |  | Path. |
| `autoreset` | `String` | no | `yyyy` | Auto-reset. One of: `yyyy` (Yearly), `MM` (Monthly), `dd` (Daily). |
| `start` | `Number` | no | `0` | Start from. |
| `reset` | `Boolean` | no | `false` | Reset indexer. |

**Inputs:** `input` (Input).  
**Outputs:** `output` (Output).

The component will generate a variable symbol according to a custom format.
