generate-file
This action generates files such as PDFs, CSVs, or text files. It accepts content to be written to the file, along with an optional encoding parameter. Once generated, the file's URI is returned and included in the action instance output.
Configuration options
Some properties are common to all components, see Common component properties for a list and their configuration options.
content
The content to be included in the file. You can use datasources, expressions, or text.
fileName
Give the file a name, this name is used as the local file name, and is referenced as part of the uri, which can be accessed via the action's instance output ([email protected]). The file extension must be included in the fileName, e.g., Application.txt.
instanceId
Provide a unique identifier for the action, which provides access to the action's state.
title
Provide the action button with a title, for example, Create Application.
encoding
The encoding parameter specifies how an already encoded file should be interpreted when it is read. It does not encode the file itself but rather determines how the provided file content is decoded. Accepted encoding options:
utf8- defaultasciibase64- All three encoding types are supported and will return errors if the provided file content is incompatible with the selected encoding. If a plain text string (e.g., "Hello World") is supplied with base64 encoding, the file will appear empty because it is not a valid base64-encoded string. When a valid base64 string (e.g., "SGVsbG8sIFdvcmx" for "Hello World") is provided, it will be decoded correctly, resulting in a readable file with the expected content. After reading the file, can be configured if needed.
Considerations
You can reference the local file using the action's output uri in other actions or components,
[email protected]. For example, generate the file then share the file.Depending on where you save and use the saved file, you might need to use conversions.
The file extension must be included in the
fileName, e.g., FormA.docx.
Examples and code snippets
Generate and share the file

In this example, an action list contains two actions: the first generates a text file, the second shares the file via a sharing app on the device.
Last updated
Was this helpful?