Overview
The Query Builder (Simple Mode) provides an intuitive, no-code way to find files in Salesforce. Use dropdown filters to build your query visually - FileFetch automatically generates the SOQL query for you.Simple Mode is perfect for users who aren’t familiar with SOQL or want a faster way to build common queries. For advanced queries, use Power Mode.
Export Type Selection
Before querying, choose what type of files to export:- Files (ContentVersion)
- Attachments
Modern Salesforce FilesExport files stored in Salesforce Files (the modern file storage system).
- Object: ContentVersion
- Use For: Files attached to records after Winter ‘12
- Features: Version control, rich metadata, superior organization
- Common Use Cases: Documents on Accounts, Cases, Opportunities, custom objects
The export type determines which Salesforce object is queried and which filters are available. You can switch between types at any time.
Quick Filters
Quick Filters provide the most common filtering options. These filters automatically update the generated SOQL query.Date Range Filter
Filter files by when they were created:| Option | Description | SOQL |
|---|---|---|
| Any | No date filter (default) | (none) |
| Last 7 Days | Files created in the last week | CreatedDate = LAST_N_DAYS:7 |
| Last 30 Days | Files created in the last month | CreatedDate = LAST_N_DAYS:30 |
| Last 90 Days | Files created in the last quarter | CreatedDate = LAST_N_DAYS:90 |
| This Year | Files created this calendar year | CreatedDate = THIS_YEAR |
| Last Year | Files created last calendar year | CreatedDate = LAST_YEAR |
File Type Filter
Filter by common file extensions:| Option | Extensions | Example Files |
|---|---|---|
| Any | All file types | All files |
| PDFs | .pdf | Reports, contracts, forms |
| Word Documents | .doc, .docx | Letters, proposals, documentation |
| Excel Spreadsheets | .xls, .xlsx | Data sheets, financial reports |
| Images (PNG/JPG/GIF) | .png, .jpg, .jpeg, .gif | Photos, screenshots, diagrams |
| PowerPoint | .ppt, .pptx | Presentations, slide decks |
For Files (ContentVersion), this filters the
FileExtension field.For Attachments, this filters the Name field using pattern matching (e.g., Name LIKE '%.pdf').File Size Filter
Filter files by size:| Option | Size Range | SOQL Condition |
|---|---|---|
| Any | All sizes | (none) |
| Small | Less than 1MB | ContentSize < 1048576 |
| Medium | 1MB to 10MB | ContentSize >= 1048576 AND ContentSize <= 10485760 |
| Large | Greater than 10MB | ContentSize > 10485760 |
- For Files, uses
ContentSizefield (bytes) - For Attachments, uses
BodyLengthfield (bytes)
Related Object Filter
Filter files attached to specific Salesforce objects: Available objects:- All Objects - No filtering by parent object
- Accounts - Files on Account records
- Contacts - Files on Contact records
- Opportunities - Files on Opportunity records
- Cases - Files on Case records
- Leads - Files on Lead records
Advanced Filters
Click Show More Filters to access additional filtering options:Version Filter (Files Only)
Choose which file versions to include:- Latest Only (default) - Only the most recent version of each file
- Adds
IsLatest = trueto the query - Recommended for most exports
- Adds
- All Versions - Include all historical versions
- No version filter applied
- Use when you need version history
This filter only applies to Files (ContentVersion). Attachments don’t have versions.
Title/Name Contains
Search for files with specific text in their name:- For Files: Searches the
Titlefield - For Attachments: Searches the
Namefield - Matching: Case-insensitive, partial match
- SOQL:
Title LIKE '%searchterm%'
Invoice_2024.pdfCustomer Invoice - March.docxINVOICE-FINAL.xlsx
Result Limit
Control how many results to return:| Limit | Use Case |
|---|---|
| 50 | Quick previews, testing queries |
| 100 | Default for most queries |
| 200 | Moderate-sized exports |
| 500 | Large exports |
| 1000 | Maximum single query |
Generated Query Preview
As you adjust filters, the Generated Query section shows the SOQL that will be executed:The preview is read-only in Simple Mode. To edit the query directly, switch to Power Mode.
Running Your Query
1
Set Your Filters
Choose the filters that match the files you want to export
2
Review Generated Query
Check the query preview to ensure it matches your intent
3
Execute
Click Run Query or press
⌘/Ctrl + EnterFileFetch will:- Execute the SOQL query against Salesforce
- Retrieve matching file metadata
- Display results in the table below
4
Review Results
The results table shows:
- File title/name
- Extension
- Size
- Created date
- Last modified date
- Select checkboxes for export
Example Queries
Here are common filter combinations:All PDFs from the last 30 days
All PDFs from the last 30 days
Filters:
- Date Range: Last 30 Days
- File Type: PDFs
- File Size: Any
- Related Object: All Objects
Large images on Opportunities
Large images on Opportunities
Filters:
- Date Range: Any
- File Type: Images (PNG/JPG/GIF)
- File Size: Large (>10MB)
- Related Object: Opportunities
All Word documents this year
All Word documents this year
Filters:
- Date Range: This Year
- File Type: Word Documents
- File Size: Any
- Related Object: All Objects
Small files on Cases (last 90 days)
Small files on Cases (last 90 days)
Filters:
- Date Range: Last 90 Days
- File Type: Any
- File Size: Small (<1MB)
- Related Object: Cases
Excel spreadsheets with 'Report' in the title
Excel spreadsheets with 'Report' in the title
Filters:
- Date Range: Any
- File Type: Excel Spreadsheets
- File Size: Any
- Related Object: All Objects
- Advanced: Title Contains: “Report”
Switching to Power Mode
Need more control? Switch to Power Mode:- Toggle Power Mode switch in the query editor header
- The visual filters will be replaced with a SOQL editor
- Your generated query will be pre-filled
- Edit the query directly with full SOQL syntax
Tips & Best Practices
Start Broad, Then Narrow
Begin with loose filters, then add more constraints based on results
Use Date Filters First
Date filtering is the fastest way to reduce result set size
Test in Sandbox
Try your queries in a Sandbox environment before Production
Monitor Result Count
If you hit the limit, add more specific filters
Limitations
Simple Mode has some limitations compared to Power Mode:| Feature | Simple Mode | Power Mode |
|---|---|---|
| Visual Filters | ✅ Yes | ❌ No |
| Custom SOQL | ❌ No | ✅ Yes |
| Field Selection | ❌ Fixed fields | ✅ Choose any fields |
| Complex WHERE Clauses | ❌ No | ✅ Yes (AND, OR, NOT) |
| Subqueries | ❌ No | ✅ Yes |
| Custom Object Filters | ❌ Limited to 5 standard | ✅ Any object |
| ORDER BY | ❌ No | ✅ Yes |
| GROUP BY | ❌ No | ✅ Yes |