---
title: "generate from value · RUAL Documentation"
description: "Generates a file from the given value."
canonical: https://docs.rual.nl/block-types/files/file_from_value
language: en
---

# generate from value

This block is part of the [`files`](https://docs.rual.nl/block-types/files) group and was last modified in core [`v10.4.28`](https://docs.rual.nl/core-versions/100428).

Generates a file from the given value.

- flow `flow`

- filename required `value` The name of the file.

- extension required `value` The extension of the file, e.g. `pdf`.

- data required `value` The contents of the file, e.g. JSON, XML or CSV data.

- encoding `value` The encoding of the data, can be ascii or utf8

Default `utf8`

- win. newline char `condition` Use a windows EOL character (\r\n) instead of the mac / linux EOL character (\n)

- flow `flow`

- success `condition` File succesfully created?

- file `file` Output file.

A typical wiring for [generate from value](https://docs.rual.nl/block-types/files/file_from_value): a [function trigger](https://docs.rual.nl/block-types/globals/trigger_custom_function) starts the flow; [value](https://docs.rual.nl/block-types/value/value_default) feeds the `filename` pin; [value](https://docs.rual.nl/block-types/value/value_default) feeds the `extension` pin; [value](https://docs.rual.nl/block-types/value/value_default) feeds the `content` pin; the `flow` out pin feeds [debug](https://docs.rual.nl/block-types/state%20ui/state_debug).

![Studio canvas example for the generate from value block: typical wiring for generate from value.](https://docs.rual.nl/canvas-examples/file_from_value.png)

### Version history

Introduced in [`v10.4.28`](https://docs.rual.nl/core-versions/100428).
