Skip to main content

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:
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:
OptionDescriptionSOQL
AnyNo date filter (default)(none)
Last 7 DaysFiles created in the last weekCreatedDate = LAST_N_DAYS:7
Last 30 DaysFiles created in the last monthCreatedDate = LAST_N_DAYS:30
Last 90 DaysFiles created in the last quarterCreatedDate = LAST_N_DAYS:90
This YearFiles created this calendar yearCreatedDate = THIS_YEAR
Last YearFiles created last calendar yearCreatedDate = LAST_YEAR
Date filters use the CreatedDate field. To filter by modification date, use Power Mode with LastModifiedDate.

File Type Filter

Filter by common file extensions:
OptionExtensionsExample Files
AnyAll file typesAll files
PDFs.pdfReports, contracts, forms
Word Documents.doc, .docxLetters, proposals, documentation
Excel Spreadsheets.xls, .xlsxData sheets, financial reports
Images (PNG/JPG/GIF).png, .jpg, .jpeg, .gifPhotos, screenshots, diagrams
PowerPoint.ppt, .pptxPresentations, 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:
OptionSize RangeSOQL Condition
AnyAll sizes(none)
SmallLess than 1MBContentSize < 1048576
Medium1MB to 10MBContentSize >= 1048576 AND ContentSize <= 10485760
LargeGreater than 10MBContentSize > 10485760
  • For Files, uses ContentSize field (bytes)
  • For Attachments, uses BodyLength field (bytes)
Filter files attached to specific Salesforce objects:
Important: This filter works differently than the others!FileFetch uses a two-query approach:
  1. First, queries the selected object (e.g., Account) to get Record IDs
  2. Then, queries files linked to those records via ContentDocumentLink
This ensures you only get files attached to the selected object type.
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
To filter by custom objects or use additional criteria (e.g., “Accounts in California”), use Power Mode.

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 = true to the query
    • Recommended for most exports
  • 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 Title field
  • For Attachments: Searches the Name field
  • Matching: Case-insensitive, partial match
  • SOQL: Title LIKE '%searchterm%'
Example: Entering “invoice” will find:
  • Invoice_2024.pdf
  • Customer Invoice - March.docx
  • INVOICE-FINAL.xlsx

Result Limit

Control how many results to return:
LimitUse Case
50Quick previews, testing queries
100Default for most queries
200Moderate-sized exports
500Large exports
1000Maximum single query
If you need more than 1000 files, consider:
  • Using more specific filters to narrow results
  • Running multiple queries with different date ranges
  • Using CSV Import if you have a list of file IDs

Generated Query Preview

As you adjust filters, the Generated Query section shows the SOQL that will be executed:
SELECT Id, Title, ContentDocumentId, FileExtension,
       ContentSize, CreatedDate, LastModifiedDate
FROM ContentVersion
WHERE IsLatest = true
  AND CreatedDate = LAST_N_DAYS:30
  AND FileExtension = 'pdf'
  AND ContentSize < 1048576
LIMIT 100
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:
  1. Execute the SOQL query against Salesforce
  2. Retrieve matching file metadata
  3. 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:
Filters:
  • Date Range: Last 30 Days
  • File Type: PDFs
  • File Size: Any
  • Related Object: All Objects
Use Case: Recent contract documents, reports
Filters:
  • Date Range: Any
  • File Type: Images (PNG/JPG/GIF)
  • File Size: Large (>10MB)
  • Related Object: Opportunities
Use Case: High-resolution product photos, diagrams
Filters:
  • Date Range: This Year
  • File Type: Word Documents
  • File Size: Any
  • Related Object: All Objects
Use Case: Annual documentation export
Filters:
  • Date Range: Last 90 Days
  • File Type: Any
  • File Size: Small (<1MB)
  • Related Object: Cases
Use Case: Customer support ticket attachments
Filters:
  • Date Range: Any
  • File Type: Excel Spreadsheets
  • File Size: Any
  • Related Object: All Objects
  • Advanced: Title Contains: “Report”
Use Case: Finding all reports across the org

Switching to Power Mode

Need more control? Switch to Power Mode:
  1. Toggle Power Mode switch in the query editor header
  2. The visual filters will be replaced with a SOQL editor
  3. Your generated query will be pre-filled
  4. Edit the query directly with full SOQL syntax
Switching to Power Mode disables the visual filters. You’ll need to write SOQL manually. Switch back to Simple Mode to use filters again (this will reset your query).

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:
FeatureSimple ModePower 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
For advanced use cases, see Power Mode.

Next Steps