Skip to main content

Overview

Power Mode gives you full control over file queries by allowing you to write custom SOQL (Salesforce Object Query Language) directly. This is ideal for advanced users who need complex filtering, custom field selection, or queries that go beyond what Simple Mode offers.
Power Mode requires SOQL knowledge. If you’re new to SOQL, start with Query Builder (Simple Mode) or review our SOQL Examples.

Enabling Power Mode

To switch to Power Mode:
  1. Navigate to the Query & Export page
  2. Find the Power Mode toggle in the query editor header
  3. Click the toggle to enable Power Mode
  4. The visual filters will be replaced with a Monaco code editor
Your Simple Mode filters will be converted to SOQL and pre-filled in the editor. You can then modify the query as needed.

The SOQL Editor

Power Mode features a Monaco editor (the same editor used in VS Code) with:

Syntax Highlighting

SQL syntax highlighting for better readability

Line Numbers

Easily reference and debug specific lines

Multi-line Editing

Write complex queries across multiple lines

Keyboard Shortcuts

Execute with ⌘/Ctrl + Enter

Editor Features

  • Dark Mode Support: Automatically matches your system theme
  • Word Wrap: Long queries wrap for better visibility
  • Tab Size: 2 spaces for clean formatting
  • No Minimap: Maximized editing space

Supported SOQL Features

FileFetch supports standard SOQL syntax for querying Salesforce objects:

SELECT Clause

Specify which fields to retrieve:
FileFetch requires certain fields for file downloads to work:For ContentVersion (Files):
  • Id - Record identifier
  • ContentDocumentId - Required for download
For Attachment:
  • Id - Record identifier (also used for download)

WHERE Clause

Filter results with conditions:
Supported Operators:
  • Comparison: =, !=, <, >, <=, >=
  • Logical: AND, OR, NOT
  • Pattern matching: LIKE
  • List: IN, NOT IN
  • Date literals: LAST_N_DAYS:n, THIS_YEAR, LAST_YEAR, etc.

LIMIT Clause

Control the number of results:
Salesforce API Limits: SOQL queries are limited to 2,000 rows per query. If you need more files, use CSV Import or run multiple queries with different filters.

ORDER BY Clause

Sort results:
Common Sorting:
  • ORDER BY CreatedDate DESC - Newest first
  • ORDER BY CreatedDate ASC - Oldest first
  • ORDER BY Title ASC - Alphabetical by name
  • ORDER BY ContentSize DESC - Largest files first

Object Filtering

Power Mode allows you to query files attached to specific objects using custom criteria.
Note: The object filter dropdown is disabled in Power Mode. If you need to filter by related objects, you must write the query logic manually.
FileFetch uses a two-query approach when filtering by objects:
  1. First query: Fetch record IDs from the target object (e.g., Account)
  2. Second query: Fetch files linked to those records via ContentDocumentLink
Example: To find files on Accounts in California:
For advanced object filtering, contact support or see SOQL Examples.

Common Query Patterns

All PDFs Created This Year

Large Files (> 10MB)

Files Modified in Last 7 Days

Specific File Types

Files with Specific Title Pattern

All Versions of Files

Querying Attachments

For legacy attachments, query the Attachment object:
Key Differences from ContentVersion:
  • Use Name instead of Title
  • Use BodyLength instead of ContentSize
  • No FileExtension field (use pattern matching on Name)
  • No version support (IsLatest not applicable)
  • ParentId links directly to parent record

Query Validation

FileFetch validates your query before execution:
Query executes successfully and returns results in the table below the editor.
Error: unexpected token: 'SELCT'Cause: Typo or invalid SOQL syntaxSolution: Review the query for typos and ensure proper SOQL syntax
Error: No such column 'InvalidField' on entity 'ContentVersion'Cause: Field doesn’t exist on the objectSolution: Check field API names in Salesforce or see Salesforce Objects Reference
Error: Query must include ContentDocumentId for file downloadsCause: Required field not in SELECT clauseSolution: Add the required field to your SELECT clause
Warning: Query returned 2000 rows (SOQL limit reached)Cause: Query matches more than 2000 recordsSolution: Add more specific WHERE conditions or use LIMIT

Query History

FileFetch automatically saves your query history:
  1. Click the Query History icon in the sidebar
  2. View previously executed queries
  3. Click a query to reload it in the editor
  4. Edit and re-execute as needed
Query history is saved locally and persists between sessions. Use this to quickly re-run common queries or learn from past searches.

Help Text

While editing in Power Mode, you can access contextual help:
  • Click the ? icon or Help link
  • View quick reference for SOQL syntax
  • See examples of common WHERE clauses
  • Access field reference for ContentVersion and Attachment

Switching Back to Simple Mode

To return to visual filters:
  1. Toggle Power Mode off
  2. Your custom query will be reset to the default Simple Mode query
  3. The visual filter dropdowns will reappear
Switching back to Simple Mode discards your custom SOQL query. If you want to keep it, copy it first or save it in Query History.

Best Practices

Start Simple, Add Complexity

Begin with a basic query, then add filters incrementally

Test with LIMIT

Use small LIMIT values while testing, then increase for full export

Use ORDER BY

Sort results for predictable ordering and easier review

Comment Your Queries

Use -- for comments to document complex query logic

Limitations

Power Mode has some restrictions:

Advanced Examples

Files Created by Specific User

Files Larger Than Average

Files with Multiple Extensions

Getting Help

SOQL Examples

Common query patterns and templates

Salesforce Objects

Field reference for ContentVersion and Attachment

Troubleshooting

Common query errors and solutions

Salesforce SOQL Guide

Official Salesforce SOQL documentation