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:- Navigate to the Query & Export page
- Find the Power Mode toggle in the query editor header
- Click the toggle to enable Power Mode
- 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 + EnterEditor 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:WHERE Clause
Filter results with conditions:- 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:ORDER BY Clause
Sort results:ORDER BY CreatedDate DESC- Newest firstORDER BY CreatedDate ASC- Oldest firstORDER BY Title ASC- Alphabetical by nameORDER BY ContentSize DESC- Largest files first
Object Filtering
Power Mode allows you to query files attached to specific objects using custom criteria. FileFetch uses a two-query approach when filtering by objects:- First query: Fetch record IDs from the target object (e.g., Account)
- Second query: Fetch files linked to those records via ContentDocumentLink
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:- Use
Nameinstead ofTitle - Use
BodyLengthinstead ofContentSize - No
FileExtensionfield (use pattern matching onName) - No version support (
IsLatestnot applicable) ParentIdlinks directly to parent record
Query Validation
FileFetch validates your query before execution:✅ Valid Query
✅ Valid Query
Query executes successfully and returns results in the table below the editor.
❌ Syntax Error
❌ Syntax Error
Error:
unexpected token: 'SELCT'Cause: Typo or invalid SOQL syntaxSolution: Review the query for typos and ensure proper SOQL syntax❌ Invalid Field
❌ Invalid Field
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❌ Missing Required Field
❌ Missing Required Field
Error: Query must include
ContentDocumentId for file downloadsCause: Required field not in SELECT clauseSolution: Add the required field to your SELECT clause⚠️ Too Many Results
⚠️ Too Many Results
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:- Click the Query History icon in the sidebar
- View previously executed queries
- Click a query to reload it in the editor
- Edit and re-execute as needed
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:- Toggle Power Mode off
- Your custom query will be reset to the default Simple Mode query
- The visual filter dropdowns will reappear
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 logicLimitations
Power Mode has some restrictions:| Feature | Supported | Notes |
|---|---|---|
| SELECT | ✅ Yes | Must include required fields for downloads |
| WHERE | ✅ Yes | All standard SOQL operators |
| ORDER BY | ✅ Yes | Single or multiple fields |
| LIMIT | ✅ Yes | Max 2000 (Salesforce limit) |
| OFFSET | ❌ No | Not supported by FileFetch |
| GROUP BY | ❌ No | Not applicable for file exports |
| HAVING | ❌ No | Not applicable for file exports |
| Subqueries | ⚠️ Limited | Only in WHERE clause, not FROM |
| Aggregate Functions | ❌ No | COUNT, SUM, etc. not supported |
| JOIN | ❌ No | Use ContentDocumentLink filtering instead |