---
title: "build csv · RUAL Documentation"
description: "RUAL files block."
canonical: https://docs.rual.nl/block-types/files/function_build_csv
language: en
---

# build csv

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

- flow `flow`

- filename required `value`

- header required `array`

- values required `array`

- options `object`

- flow `flow`

- CSV file `file`

- success `v13.0.7` `condition`

- error `v13.0.7` `value`

A [function trigger](https://docs.rual.nl/block-types/globals/trigger_custom_function) runs the report: a [date histogram](https://docs.rual.nl/block-types/aggregation/aggregation_type_date_histogram_bp_field) groups documents per day, [aggregation](https://docs.rual.nl/block-types/query/query_aggregation) names it and feeds [search](https://docs.rual.nl/block-types/storage/function_search), and [build CSV](https://docs.rual.nl/block-types/files/function_build_csv) turns the result rows into a file that [reply with file](https://docs.rual.nl/block-types/http%20connection/httpconnection_set_file) downloads to the caller.

![Studio canvas example for the build CSV block: an aggregation straight into a CSV download.](https://docs.rual.nl/canvas-examples/function_build_csv.png)

### Version history

Introduced in [`v13.0.7`](https://docs.rual.nl/core-versions/130007).
