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

# Export Configuration

> Configure how files are organized, named, and exported

## Overview

The Export Configuration panel allows you to control how FileFetch organizes, names, and downloads your files. Configure these settings before exporting to ensure files land exactly where you want them, with the structure you need.

<Info>
  Export configuration settings are preserved between sessions. FileFetch remembers your preferences for future exports.
</Info>

## Export Type

Choose which type of Salesforce files to export:

<Tabs>
  <Tab title="Files (ContentVersion)">
    **Modern Salesforce Files**

    Export files from the Salesforce Files system (ContentVersion/ContentDocument).

    * Uses ContentDocument API
    * Supports versioning
    * Richer metadata available
    * Attached via ContentDocumentLink

    **Best For**:

    * Files attached after Winter '12
    * Modern Salesforce implementations
    * Files with version history
  </Tab>

  <Tab title="Attachments">
    **Legacy Attachments**

    Export classic Salesforce Attachments.

    * Uses Attachment API
    * No version support
    * Directly attached to parent records
    * Older file storage method

    **Best For**:

    * Legacy data not migrated to Files
    * Attachments on older records
    * Simple attachment exports
  </Tab>
</Tabs>

<Warning>
  Changing the Export Type resets your query and results. Make sure to select the correct type before querying.
</Warning>

## File Organization

### Group by Related Record

When enabled, FileFetch organizes exported files into folders based on their parent Salesforce records.

<Tabs>
  <Tab title="Enabled (Recommended)">
    **Organized by Parent Record**

    Files are grouped into folders named after the related record.

    **Example Structure**:

    ```
    FileFetch_Export_2024-10-01_143025/
    ├── Acme_Corporation_001xx000000AAAAA/
    │   ├── Contract_2024.pdf
    │   ├── Proposal_Q1.docx
    │   └── Logo.png
    ├── Beta_Industries_001xx000000BBBBB/
    │   ├── Invoice_January.xlsx
    │   └── Product_Specs.pdf
    └── _Export_Summary.txt
    ```

    **Folder Naming**:

    * Format: `{RecordName}_{RecordId}`
    * Example: `Acme_Corporation_001xx000000AAAAA`
    * Sanitized for file system compatibility (special characters removed)

    <Tip>
      Use this option when you want files organized by customer, case, opportunity, or any parent object. Makes it easy to see which files belong to which record.
    </Tip>
  </Tab>

  <Tab title="Disabled">
    **Flat Structure**

    All files are exported to a single folder without subfolders.

    **Example Structure**:

    ```
    FileFetch_Export_2024-10-01_143025/
    ├── Contract_2024.pdf
    ├── Proposal_Q1.docx
    ├── Logo.png
    ├── Invoice_January.xlsx
    ├── Product_Specs.pdf
    └── _Export_Summary.txt
    ```

    <Warning>
      If multiple files have the same name, FileFetch will apply duplicate handling rules (see below).
    </Warning>
  </Tab>
</Tabs>

## File Naming

Control how exported files are named:

### Use Real File Names (Recommended)

<Tabs>
  <Tab title="Enabled">
    **Original File Names**

    Files are saved with their original names from Salesforce.

    * **Files**: Uses the `Title` field + file extension
    * **Attachments**: Uses the `Name` field

    **Example**:

    * `Annual_Contract.pdf`
    * `Q1_Invoice.xlsx`
    * `Product_Photo.jpg`

    <Tip>
      This is the most user-friendly option. Files have recognizable, meaningful names that match what's in Salesforce.
    </Tip>
  </Tab>

  <Tab title="Disabled">
    **Salesforce Record IDs**

    Files are saved using their Salesforce IDs.

    * **Files**: Uses ContentDocumentId
    * **Attachments**: Uses Attachment Id

    **Example**:

    * `069xx000000ABCDEA4.pdf`
    * `069xx000000EFGHEA4.xlsx`
    * `00Pxx000000IJKLEA4.jpg`

    **Use When**:

    * You need to maintain exact ID tracking
    * Integrating with external systems that expect IDs
    * Avoiding any possible filename conflicts
  </Tab>
</Tabs>

## Duplicate Handling

When multiple files have the same name, FileFetch can handle duplicates in two ways:

<Tabs>
  <Tab title="Append ID">
    **Add Salesforce ID to Duplicate Names**

    If a file with the same name already exists, append the ContentDocumentId or Attachment Id to make it unique.

    **Example**:

    ```
    Contract.pdf
    Contract_069xx000000ABCDEA4.pdf  ← Duplicate, ID appended
    Contract_069xx000000EFGHEA4.pdf  ← Another duplicate
    ```

    <Tip>
      **Recommended**: This ensures all files are exported, even if they have identical names. You never lose data.
    </Tip>
  </Tab>

  <Tab title="Skip Duplicates">
    **Skip Files with Duplicate Names**

    If a file with the same name already exists, skip the duplicate and move to the next file.

    **Example**:

    ```
    Contract.pdf  ← First file saved
    ← Duplicate skipped
    ← Another duplicate skipped
    ```

    <Warning>
      **Data Loss Risk**: This can result in missing files if multiple files share the same name. Only use this if you're certain file names are unique.
    </Warning>

    **Export Summary** will show:

    ```
    Files Skipped (Duplicates): 2
    - Contract.pdf (ContentDocumentId: 069xx000000ABCDEA4)
    - Contract.pdf (ContentDocumentId: 069xx000000EFGHEA4)
    ```
  </Tab>
</Tabs>

## Export Location

### Default Export Folder

FileFetch exports files to a default location on your computer:

<Tabs>
  <Tab title="macOS">
    **Default Location**: `~/Downloads/FileFetch_Exports/`

    Each export creates a timestamped subfolder:

    ```
    ~/Downloads/FileFetch_Exports/
    └── FileFetch_Export_2024-10-01_143025/
        ├── [exported files]
        └── _Export_Summary.txt
    ```

    <Tip>
      You can change the default export folder in [Settings](/settings).
    </Tip>
  </Tab>

  <Tab title="Windows">
    **Default Location**: `C:\Users\{YourName}\Downloads\FileFetch_Exports\`

    Each export creates a timestamped subfolder:

    ```
    C:\Users\YourName\Downloads\FileFetch_Exports\
    └── FileFetch_Export_2024-10-01_143025\
        ├── [exported files]
        └── _Export_Summary.txt
    ```

    <Tip>
      You can change the default export folder in [Settings](/settings).
    </Tip>
  </Tab>
</Tabs>

### Custom Export Folder (Coming Soon)

<Note>
  **Future Feature**: The ability to select a custom export folder for each export is planned for a future release. For now, use the default location or change it in Settings.
</Note>

## Folder Naming Convention

Export folders follow this naming pattern:

```
FileFetch_Export_{YYYY-MM-DD}_{HHMMSS}
```

**Example**: `FileFetch_Export_2024-10-01_143025`

* **YYYY-MM-DD**: Date of export (year-month-day)
* **HHMMSS**: Time of export (24-hour format)

This ensures:

* Exports are easy to identify by date/time
* No folder name conflicts (each export has a unique timestamp)
* Chronological sorting in file explorer

## Export Summary

Every export includes an `_Export_Summary.txt` file with detailed information:

```
==============================================
FileFetch Export Summary
==============================================
Export Date: 2024-10-01 14:30:25
Export Type: Files (ContentVersion)
Salesforce Org: https://your-domain.my.salesforce.com

==============================================
Export Configuration
==============================================
Grouped by Related Record: Yes
Use Real File Names: Yes
Duplicate Handling: Append ID
Export Folder: /Users/you/Downloads/FileFetch_Exports/FileFetch_Export_2024-10-01_143025

==============================================
Export Results
==============================================
Total Files Queried: 150
Files Successfully Downloaded: 147
Files Failed: 2
Files Skipped (Duplicates): 1

==============================================
Failed Downloads
==============================================
1. Invoice_March.pdf (ContentDocumentId: 069xx000000ABCDEA4)
   Error: Download timeout after 120 seconds

2. Report_Q2.xlsx (ContentDocumentId: 069xx000000EFGHEA4)
   Error: File not found or access denied

==============================================
Skipped Files (Duplicates)
==============================================
1. Contract.pdf (ContentDocumentId: 069xx000000IJKLEA4)
   Reason: File with same name already exists

==============================================
Download Statistics
==============================================
Total Download Size: 1.2 GB
Average File Size: 8.2 MB
Download Duration: 5 minutes 32 seconds
Average Download Speed: 3.6 MB/s
Concurrent Downloads: 10

==============================================
```

<Tip>
  The Export Summary is invaluable for auditing, troubleshooting, and tracking which files were exported. Always review it after large exports.
</Tip>

## Recommended Settings

For most users, we recommend:

<CardGroup cols={2}>
  <Card title="Export Type" icon="folder">
    **Files (ContentVersion)** for modern Salesforce data
  </Card>

  <Card title="Group by Related Record" icon="folder-tree">
    **Enabled** for organized folder structure
  </Card>

  <Card title="File Naming" icon="tag">
    **Use Real File Names** for readability
  </Card>

  <Card title="Duplicate Handling" icon="copy">
    **Append ID** to avoid data loss
  </Card>
</CardGroup>

## Special Considerations

### Large Exports

For exports with hundreds or thousands of files:

* **Enable grouping**: Easier to navigate than a flat structure with 1000+ files
* **Use real file names**: Helps identify files quickly
* **Append ID for duplicates**: Ensures all files are exported
* **Monitor Export Summary**: Check for failed downloads

### Integration/Automation

If exporting for integration with external systems:

* **Disable grouping**: Flat structure may be easier to process programmatically
* **Use Salesforce IDs**: External systems may expect ID-based naming
* **Skip duplicates**: If your workflow handles deduplication separately
* **Parse Export Summary**: Programmatically read the summary file for results

### Record-Specific Exports

When exporting files for specific records (e.g., one Account's files):

* **Enable grouping**: Even for a single record, creates clear organization
* **Use real file names**: Makes files immediately recognizable
* **Append ID for duplicates**: Avoid losing files with same names

## Changing Configuration Mid-Export

<Warning>
  You cannot change export configuration while an export is in progress. Wait for the current export to complete, then adjust settings for the next export.
</Warning>

If you need to stop an export:

1. Click **Cancel Export** in the progress dialog
2. Adjust your configuration
3. Re-run the export

## Next Steps

<CardGroup cols={2}>
  <Card title="Export History" icon="clock-rotate-left" href="/export-history">
    View past exports and retry failed downloads
  </Card>

  <Card title="Settings" icon="sliders" href="/settings">
    Configure default export folder and download behavior
  </Card>

  <Card title="Performance" icon="gauge-high" href="/performance">
    Optimize download speeds and concurrent connections
  </Card>

  <Card title="Troubleshooting" icon="wrench" href="/troubleshooting">
    Common export issues and solutions
  </Card>
</CardGroup>
