SOQL Query Builder
Build SOQL queries visually. Select an object, pick fields, add filters, and copy the ready-to-use SOQL.
Use these in WHERE clauses for Date or DateTime fields instead of exact strings.
| YESTERDAY | Starts 12:00:00 AM the previous day, lasts 24h. |
| TODAY | Starts 12:00:00 AM the current day, lasts 24h. |
| TOMORROW | Starts 12:00:00 AM the next day, lasts 24h. |
| LAST_WEEK | Starts 12:00:00 AM on the first day of the week before. |
| THIS_WEEK | Starts 12:00:00 AM on the first day of the current week. |
| LAST_N_DAYS:n | The previous n days. e.g. LAST_N_DAYS:30 |
| NEXT_N_DAYS:n | The next n days. |
1SELECT2 Id,3 Name4FROM Account5LIMIT 200
About the SOQL Query Builder
SOQL is the primary way to read data from Salesforce — in Apex code, in the Developer Console, and in integrations. Writing SOQL by hand means memorizing object API names, field names, and relationship names. This visual builder lets you select objects and fields from a searchable list, add WHERE conditions, configure ORDER BY and LIMIT, and generates the correct SOQL string and REST API URL instantly.
What this tool builds
Field Selection
Browse and select fields from standard Salesforce objects. Includes relationship fields for parent-to-child and child-to-parent traversal.
WHERE Conditions
Add multiple filter conditions with AND/OR logic. Supports all SOQL operators: =, !=, <, >, LIKE, IN, NOT IN, INCLUDES, EXCLUDES.
ORDER BY & LIMIT
Configure sort fields, direction (ASC/DESC), NULLS FIRST/LAST, and record limits. Essential for pagination and performance.
REST API URL
Generates the URL-encoded REST API endpoint alongside the SOQL string — ready to use with Workbench, Postman, or your integration.
SOQL best practices
- Never put SOQL queries inside
forloops — collect IDs first, then query once - Always add a
LIMITclause when querying large objects likeTaskorEmailMessage - Use selective filters on indexed fields (
Id,Name,OwnerId, custom external IDs) for performance - Use
WITH SECURITY_ENFORCEDorWITH USER_MODEto respect field-level security
Pipeline
- Apex Formatter — format the generated SOQL for readability.
- Debug Log Analyzer — analyze SOQL performance from debug logs.
- JSON to Apex — generate wrapper classes for the records your query returns.
Frequently asked
- Is my SOQL query sent to a server?
- No. All query building and generation runs 100% in your browser. No query data or field names are transmitted anywhere.
- What is SOQL?
- SOQL (Salesforce Object Query Language) is Salesforce's SQL-like query language for retrieving records from the Salesforce database. It supports SELECT, FROM, WHERE, ORDER BY, GROUP BY, LIMIT, and relationship traversal via dot notation.
- What is the difference between SOQL and SQL?
- SOQL is read-only — you cannot INSERT, UPDATE, or DELETE with it. It supports relationship queries (parent-to-child and child-to-parent) using dot notation and subqueries. It does not support JOINs, but relationship traversal achieves similar results.
- What are SOQL governor limits?
- Salesforce enforces governor limits to ensure fair resource usage. The key SOQL limits are: 100 SOQL queries per synchronous transaction, 200 per asynchronous transaction, and a maximum of 50,000 records returned per query. Queries in loops are the most common governor limit violation.
- How do I query related objects in SOQL?
- For child-to-parent relationships, use dot notation: SELECT Account.Name FROM Contact. For parent-to-child (subquery), use the relationship name in parentheses: SELECT Id, (SELECT Id FROM Contacts) FROM Account.
Related Tools
Governor Limits Reference
Searchable reference of all Salesforce governor limits with sync/async values and best practices.
SF CLI Builder
Build Salesforce sf CLI commands visually with flag forms and a sfdx → sf converter.
GraphQL Query Builder
Visually build GraphQL queries, mutations, and subscriptions with fields, aliases, arguments, and nested selections.
SF Object Field Analyzer
Analyze Salesforce object fields from describe API responses.
Permission Set Diff
Compare two Salesforce Permission Set XMLs side by side.
Deployment Status Dashboard
Visualize Salesforce deployment results with error details.