Amazon S3 query tutorial
Learn how to interact with S3 data.
You can connect to Amazon S3 or S3-compatible services by creating a resource in Retool. Once complete, you can write app or workflow queries to interact with S3 bucket data.
You select the action type for S3 queries that determines what action the query performs, such as listing all files or uploading data.
List all files in a bucket
Select List all files in a bucket to retrieve a list of all files. This contains information about each file, such as the file key.

You can use Prefix to filter results so only file keys that start with the same string are returned. In general, use prefixes to filter directory structure, such as images/. You can enter values directly into this field or reference component values like {{ textInput.value }}.
Read a file from S3
Select Read a file from S3 to retrieve the contents of a specified file. You set the value of S3 file key to the corresponding key of the file to retrieve. The content of the file is Base64-encoded.
For example, you can configure a Listbox component to use data from a query that lists all images in S3. The selected file is retrieved from S3 using {{ listbox1.value }} as the S3 file key, then displayed using the Image component.

Download a file from S3
Select Download a file from S3 to retrieve a specified file from the S3 bucket. This action is similar to Read a file from S3 but the file is downloaded by the browser instead of being made available by the query.