Build a Query by Using the SOQL Builder
The Salesforce Object Query Language (SOQL) Query Builder helps you build a query by using form-like visual interface. You can select the components of your query, such as the table, fields, and filters, instead of typing an actual SOQL query.
To build a query by using the SOQL Builder:
-
Open the Command Palette and type SFDX: Create Query in SOQL Builder.

-
Enter a name for the query and press Enter.
-
In the SOQL Builder, use the UI elements to indicate various parts of your query. In this example, from
Accounts,Id,Billing State, andNamedetails are shown for companies with more than 100 employees. The actual SOQL query appears in the SOQL Query box.
-
Select a table from the From dropdown list.
-
Select one or more fields to show.
-
Add one or more filter conditions for the
WHEREclause.To add a filter, select a field and an operator, and specify a value. To add another filter condition, click ADD and select
ANDorORoperator. The filters are added in the formatWHERE FIELD_NAME OPERATOR VALUE [AND/OR FIELD_NAME OPERATOR VALUE].For example,
WHERE NumberOfEmployees > 100 OR Name LIKE 'A%'. -
To sort the results, select a field as the
ORDER BYclause. Specify the order of sorting and how NULL results are shown. -
Specify the number of records to limit the results to.
To open the query in a text editor, click ![]()