---
title: "Output and storage"
slug: "xl-docs-output-and-storage"
updated: 2026-10-10T13:34:32Z
published: 2026-10-10T13:34:32Z
canonical: "help.quickbase.com/xl-docs-output-and-storage"
---
> ## Documentation Index
> Fetch the complete documentation index at: https://help.quickbase.com/llms.txt
> Use this file to discover all available pages before exploring further.
# Output and storage
Every XL Docs request decides three things about the finished document: its **format**, its **name**, and **where it goes**. This article explains each choice and the parameters that control it. For the full parameter list, see [Formula URL parameters](https://help.quickbase.com/quickbase-extensions/docs/en/xl-docs-url-parameters).
## Output formats
Set the format with **docfmt**. Write the value in lowercase. The installation wizard's **Output File Type** option (*XLSX*, *PDF*, or *CSV*) sets the same thing.
| **docfmt** | **You get** | **Details** |
| --- | --- | --- |
| *xlsx*, or leave it out | An Excel workbook in the same file type as the template: *.xlsx*, *.xls*, or *.xlsm*. | XL Docs writes values into the template's own cells, so formulas, formatting, charts, and conditional formats stay as you designed them. Pivot tables on filled sheets refresh when the workbook is opened. XL Docs doesn't convert between Excel file types—to get an *.xls* file, use an *.xls* template. |
| *pdf* | A PDF file. | All worksheets are included unless the template record's **PDF Pages** field lists the worksheets to include (for example *1,3-5*). All columns of a sheet fit on one page width, and charts are included as images. Only PDF output can be merged with other PDFs. |
| *csv* | A comma-separated values file. | Formulas don't transfer—only their values do. The file is written with a UTF-8 byte order mark (BOM) unless you add **noutf8bom=y**, which some importers (for example SAP Ariba) need. To build a CSV with header and footer rows, see [Create a CSV export file](https://help.quickbase.com/quickbase-extensions/docs/en/xl-docs-build-a-template#csv). |
## Password protection
Add **docpw** to require a password to open the document. It works for PDF and Excel output and has no effect on CSV files. Use a field value to give each document its own password:
```
& "&docpw=" & URLEncode([Document Password])
```
Opening a downloaded workbook may show Excel's own *Protected View* banner with an **Enable Editing** button. That banner comes from Excel, not from XL Docs—see [Tips and examples](https://help.quickbase.com/quickbase-extensions/docs/en/xl-docs-tips-and-examples).
## File names
**fn** is required and sets the file name without an extension; XL Docs adds *.xlsx*, *.xls*, *.xlsm*, *.pdf*, or *.csv* to match the format.
| **You write** | **Record** | **File name** |
| --- | --- | --- |
| "&fn=PurchaseOrder" | Record ID# 3 | *PurchaseOrder_3.xlsx*—the Record ID# is added by default. |
| "&fn=PurchaseOrder&fnrid=N" | Record ID# 3 | *PurchaseOrder.xlsx*—**fnrid=N** leaves the Record ID# off. |
| "&fn=PO_" & URLEncode([PO Number]) | PO Number *4471*, Record ID# 3 | *PO_4471_3.pdf* (with **docfmt=pdf**). |
| "&fn=~7.11~" | Field 7 = *Quickbase*, field 11 = *1007* | *Quickbase-1007.xlsx*—with multiple records, field IDs between tildes are replaced by each record's values, joined with hyphens. |
- The characters *\ / : * < > | ? "* and periods are removed from the name, not replaced.
- Wrap text from fields in *URLEncode()* so characters such as *&* and *#* reach XL Docs intact.
- When you save to Dropbox or to a fixed S3 key, a new document with the same name replaces the old one.
## Stream or save
The base address in the formula decides whether the user gets the document back in the browser:
| **Base address** | **Streams the document?** | **What the user sees** |
| --- | --- | --- |
| *.../ExcelGen_UA.aspx?* with **stream=y** | Yes | A PDF opens in the browser (or the pop-up). An Excel or CSV file downloads to the browser's download tray and may open in the local copy of Excel. |
| *.../ExcelGen_LP.aspx?* | No—**stream** is ignored | The progress window, then a result such as *1 Document(s) generated and uploaded successfully.* and a **Close** button. |
- **Stream and save together**—add a storage parameter such as **faid** to a streaming button. The document is saved first and then sent to the browser.
- **A streamed PDF is shown once.** The PDF is removed from the server after it's displayed; if the browser asks for it again within a few minutes it gets nothing. Save a copy (for example with **faid**) if users need to come back to it.
- **Multiple records**—with **msqry**, nothing is streamed unless **sameworkbook=y** puts every record in one workbook. Each record's document is saved instead.
- **Not streaming?** Use the *ExcelGen_LP.aspx* address so the user sees a result. With *ExcelGen_UA.aspx* and no **stream=y**, the document is saved but nothing is shown.
## Where documents are saved
You can use one storage option or combine several in the same request—for example, save to the record's file attachment field and to Amazon S3. The one combination that isn't supported is a repository table with Dropbox: a repository table can't be used with Dropbox.
The storage parameters take field IDs and table IDs from your app. To look them up, see [Find your Client ID, table IDs, and field IDs](https://help.quickbase.com/quickbase-extensions/docs/en/find-client-id-table-ids-field-ids).
| **Storage** | **Parameters** | **Set up in the wizard** |
| --- | --- | --- |
| File attachment field on the record | **faid**, **xlddte** | Installed by default (the **XL Docs Document** and **XL Docs Date** fields). |
| Repository table | **repository**, **rpdbid**, **rpfid**, **rpfidval**, **rpfafid**, **rpmode**, **rpkfid**, **rpkval**, **rpmap** | **Advanced Settings** > **Use a Repository Table**. Not available with Dropbox. |
| Amazon S3 | **amazons3**, **s3bkt**, **s3keyval**, **keyfid**, **s3key** | **Advanced Settings** > **Select a Cloud Storage Type** > **Amazon S3**. |
| Dropbox | **dropbox**, **dropboxdir**, **dropboxkeyfid** | **Advanced Settings** > **Select a Cloud Storage Type** > **Dropbox**. Not available with a repository table. |
### File attachment field on the record
**faid** is the field ID of a file attachment field on the master record (the table in **dbid**). **xlddte** is a Date/Time field on the same record that's set to the date and time the document was created. With **msqry**, each record's document is saved on that record.
```
& "&faid=51"
& "&xlddte=92"
```
### Repository table
A repository table is a separate table in your app that holds all the documents you create—one place for every file, instead of a file attachment field on each record. Each document becomes (or updates) a record in that table, related back to the master record. See also [Repository table step](https://help.quickbase.com/quickbase-extensions/docs/en/repository-table-step) in the installation wizard. A repository table can't be used with Dropbox; to keep documents in a repository table, save them to the table's file attachment field or to Amazon S3.
1. Set **repository=y** and **rpdbid** to the repository table.
2. Set **rpfafid** to the file attachment field in the repository table that receives the document.
3. Set **rpfid** to the field in the repository table that relates it to the master table (for example *[Related PO]*). XL Docs puts the master record's Record ID# there—or **rpfidval**, if the relationship uses a different key field.
4. Choose a mode with **rpmode**: *a* always adds a new repository record, so you keep every version; *u* updates the existing record for this master record (matched on **rpfid**, plus **rpkfid** = **rpkval** if you supply them). In update mode, a new record is added if none matches, and only the most recent one is updated if several match. Update mode is used if you leave **rpmode** out.
5. Optionally copy fields from the master record onto the repository record with **rpmap**, as *repository field ID:master field ID* pairs separated by *|*.
This example keeps one repository record per purchase order and document type, replacing the file each time:
```
& "&repository=y"
& "&rpdbid=" & [_DBID_DOCUMENTS]
& "&rpfid=9" // [Related PO] in the repository table
& "&rpfafid=13" // file attachment field in the repository table
& "&rpmode=u"
& "&rpkfid=20" // [Document Type] in the repository table
& "&rpkval=Purchase Order"
& "&rpmap=6:7|8:12" // copy master fields 7 and 12 into repository fields 6 and 8
```
When you save to a repository table and Amazon S3 together, set **keyfid** to the S3 key field in the repository table.
### Amazon S3
Set **amazons3=y** to save the document to your Amazon S3 bucket. Your access key, secret key, and default bucket are saved for your account during setup—see [Amazon S3 setup](https://help.quickbase.com/quickbase-extensions/docs/en/cloud-provider-amazon-s3-setup). If no S3 credentials are saved for your account, the request stops with *Cloud storage upload could not be configured for this request. Please contact support.*
- **s3bkt**—save to a different bucket than your default.
- **s3keyval**—the object key (folder path and name). *{xl_filename}* is replaced by the document's file name and *{xl_filename_dbid}* by the default key. Leading and trailing */* are removed. Without it, the key is built from the document's file name.
- **keyfid**—a text field that receives the S3 key, so the record knows where its file is. Use it to build download links (below) or to show the key on a form.
- **s3key**—overrides the saved secret key, for accounts that rotate keys themselves. Keep the value in an app variable rather than in the formula.
```
& "&docfmt=pdf"
& "&amazons3=y"
& "&s3keyval=" & URLEncode("projects/" & [Project Number] & "/{xl_filename}")
& "&keyfid=81"
```
### Dropbox
Set **dropbox=y** to save the document to Dropbox. Your Dropbox connection is set up for your account—see [Dropbox setup](https://help.quickbase.com/quickbase-extensions/docs/en/cloud-provider-dropbox-setup). Dropbox can't be used with a repository table.
- **dropboxdir**—the folder to save to, as a full path from the top of your Dropbox (for example */Invoices/2026*). Without it, the default folder set up for your account is used. A file with the same name in that folder is overwritten.
- **dropboxkeyfid** (or **dropboxfile**)—a field that holds the key linking the document to the record.
```
& "&dropbox=y"
& "&dropboxdir=" & URLEncode("/Exports/" & [Customer Name])
```
### Download links for files in cloud storage
Documents saved to Amazon S3 or Dropbox aren't in a Quickbase file attachment field, so give users a link to download them. A download link points to the *Download.aspx* address on your XL Docs server, which delivers the file to the user through a secure download link.
| **Parameter** | **Description** |
| --- | --- |
| clientid, appid, dbid, msid | Required. Your Client ID, the app, the table, and the Record ID# of the record the file belongs to. Your Client ID is the value starting with Q in your wizard-created XL Docs buttons (see [Find your Client ID, table IDs, and field IDs](https://help.quickbase.com/quickbase-extensions/docs/en/find-client-id-table-ids-field-ids)). |
| apptoken | Optional. An application token, if your app requires one. |
| psu, fn | Amazon S3: **psu=y** and **fn** set to the file's S3 key (for example the value in your **keyfid** field). The file is downloaded through a pre-signed URL. |
| dropboxfile (or dropboxkeyfid), dropboxdir | Dropbox: **dropboxfile** set to the Dropbox file, and optionally **dropboxdir** for its folder. If both Dropbox and S3 parameters are given, Dropbox is used. |
```
var text url = "https://.../Download.aspx?" // your XL Docs server URL, created by the installation wizard
& "clientid=Q#" // your Client ID
& "&appid=" & AppID()
& "&dbid=" & Dbid()
& "&msid=" & [Record ID#]
& "&psu=y"
& "&fn=" & URLEncode([S3 Key]);
"Download"
```
If a required parameter is missing, the user sees *Error downloading file: a required parameter is missing or malformed. Please double-check your request, or contact your Quickbase support representative if the issue persists.* If no file is given, the message is *Error downloading file: no file was specified to download.* See [XL Docs messages and troubleshooting](https://help.quickbase.com/quickbase-extensions/docs/en/xl-docs-messages#download-messages).
## Merge other PDFs into the document
With **docfmt=pdf**, you can add other PDF files to the generated document—for example a cover letter before it, or your terms and conditions after it. **prefiles** lists files to put before the generated PDF and **addfiles** lists files to put after it, in the order you list them. Separate items with periods. Each item can be:
| **Item** | **Meaning** | **Example** |
| --- | --- | --- |
| A field ID | A file attachment field on the current record. | *15* |
| *dbid:recid:faid* | The file in field *faid* on record *recid* in table *dbid*—for example a standard document stored once in another table. | [_DBID_TERMS] & ":1:6" |
| *RID* | Replaced by the current Record ID#. Use it inside a *dbid:recid:faid* item. | [_DBID_ATTACHMENTS] & ":RID:12" |
| *FID* plus a field ID | Replaced by that field's value on the master record, so a formula field can supply the item. | *FID523* |
| *S3\|