> ## Documentation Index
> Fetch the complete documentation index at: https://help.csvbox.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Document Metadata Fields

> Capture details such as author or invoice number straight from an uploaded file and import them as regular columns.

Document Metadata Fields let a sheet capture details straight from an uploaded file, instead of asking the person uploading to type them in. A field like `Author`, `Invoice Number`, or a fixed label is filled in automatically the moment a file is uploaded, and it shows up alongside the rest of the imported data as a regular column.

You can configure up to 20 of these per sheet, each sourced a different way depending on what kind of information you need. Configuration is stored on `Sheet.pdf_metadata_config`; extraction is handled by `App\Services\PdfMetadataExtractor`, called from `AnalyzeController`.

## Why use Document Metadata Fields

* **Invoices and receipts**: capture the invoice number or vendor name straight from the document, instead of asking the uploader to re-type it into a form field.
* **Applications and forms**: tag every submission with who authored the file or what it's titled, which is useful for sorting and follow-up later.
* **Batch labeling**: stamp every import from a particular source or partner with a fixed label, so downstream reports can filter by it.

## Field sources

Each Document Metadata Field is filled in one of three ways.

### Static Value

A fixed value typed in once. It applies to every upload processed through this sheet, which is useful for labels and tags that never change.

*Example: `Batch Label` = "Q3 Vendor Import"*

### Native Document Property

Most documents quietly carry their own properties, such as who created them or what they're titled. This source reads that value straight from the file.

*Example: `Author` = whoever created the PDF or Word document*

### Document Key-Value (Smart Match)

Give the field a name to look for, like `Invoice Number`, and CSVbox finds the value printed next to that label on the page.

*Example: field name `Invoice Number` finds "INV-4471" on the page*

## Supported file types

| File type | Static Value | Native Document Property | Document Key-Value |
| - | - | - | - |
| PDF | Yes | Yes | Yes |
| Word document (`.docx`) | Yes | Yes | Yes |
| Image (`.jpg`, `.png`) | Yes | No | Yes |

<Note>
  If a value can't be found for a field, it's left blank for that upload. This never blocks or fails the import; the rest of the file still comes through normally.
</Note>

## Enabling Document Metadata Fields

<Steps>
  <Step title="Open the File Upload settings">
    Open the sheet to configure and go to **Import Steps** → **File Upload**.
  </Step>

  <Step title="Find the Document Metadata Fields section">
    Scroll to the **Document Metadata Fields** section.
  </Step>

  <Step title="Add and name a field">
    Add a field and give it a name. This becomes the column name people see once data is imported.
  </Step>

  <Step title="Choose a source">
    Choose how the field should be filled in: **Static Value**, **Native Document Property**, or **Document Key-Value**. Provide whatever it needs (a value to use, or a label to look for).
  </Step>

  <Step title="Save the fields">
    Repeat for each detail to capture, then click **Save Metadata Fields**.
  </Step>
</Steps>

<Warning>
  Up to 20 metadata fields are allowed per sheet, and each field name must be unique.
</Warning>

From that point on, every matching upload gets these fields filled in automatically, with no extra steps for the person uploading.

### Example

A sheet set up to receive vendor invoices, with three metadata fields configured, processes an upload named `invoice_4471.pdf`:

| Field | Source | Value captured |
| - | - | - |
| `Batch Label` | Static Value | Q3 Vendor Import |
| `Author` | Native Document Property | J. Alvarez |
| `Invoice Number` | Document Key-Value | INV-4471 |

All three values are captured the moment the file is uploaded, without anyone typing them in. This happens automatically as part of processing the file, with no extra wait for the person uploading.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.