# Generate File

The Generate File action allows you to generate a file in your application. You can either prompt the user to download the file or pass the content to the next step.

For example, you can generate a CSV export from filtered values in a table:

```javascript
return {{ui.table.filteredValue}};
```

<figure><img src="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2FyYBgbCxKmBU0ousZXGyZ%2FCleanShot%202025-05-14%20at%2015.25.11%402x-min.png?alt=media&#x26;token=64b17661-37f7-4d2a-b1e7-54f0390dba8f" alt=""><figcaption></figcaption></figure>

***

Check out this article for more information about importing and exporting files in UI Bakery :point\_down:

{% content-ref url="../../how-tos/file-management/csv-import" %}
[csv-import](https://docs.uibakery.io/how-tos/file-management/csv-import)
{% endcontent-ref %}


---

# 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.uibakery.io/reference/working-with-actions/generate-file-action.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.
