Execute Queries with SOQL Builder

Code Builder enables you to quickly build and run a SOQL query. Let’s build and run a simple SOQL query on the Account object:

  1. Press Command+Shift+P (⇧⌘P) to view the Command Palette.
  2. Type “SOQL” in the search box and then select SFDX: Create Query in SOQL Builder.
  3. In the From field, select Account.
  4. In Fields, select BillingState and NumberofEmployees.
  5. Click Run Query.

If you attempt to close the query tab, you’re prompted to save your query file.

  1. Save the results to a file with a ".soql" extension.
  2. To rerun the saved query, right-click the saved file and select Open With… then select SOQL Builder. The file opens in SOQL Builder and you can rerun or edit the query.

For more information on building complex queries, see SOQL Builder in the Salesforce Extensions for Visual Studio Code guide.