---
schema_version: "1"
id: e0a820df6f965089fb248bf92da466f1b9398826d6c2668bb13b4244f3333177
title: Run Your Query
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/sfvscode/guides/programming-languages/soql/soql-running.md
canonical_url: https://developer.salesforce.com/docs/platform/sfvscode-extensions/guide/soql-running.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 25c98eea258f5bd4e6eda3ef8df00cdf40d2fceae8d5f0ddba1f6d825bfb1ecf
products:
  - Salesforce Extensions for Visual Studio Code
  - salesforcedx
---
# Run Your Query

To run your query in the Salesforce Object Query Language (SOQL) Builder, click **Run Query**. The results appear in a grid format. You can save these results in a CSV or JSON format. The files are stored under the `<project-folder>/.sfdx/data` directory.

![Query results displays in SOQL Builder](https://developer.salesforce.com/docs/platform/media/shared/query_builder_running.png '{"class": "image-lg"}')

To run your query from a text editor:

1. Click the **Run Query** text above the query text.
2. Select one of these options depending on what your query does.
   - **REST API**: Performs operations on your org's data, such as creating an account or searching for contacts
   - **Tooling API**: Performs metadata and development-lifecycle tasks, such as getting test results or reading debug logs
3. The query results display in the output panel and a CSV file is created.

   ![Run Query option in a text editor is highlighted](https://developer.salesforce.com/docs/platform/media/shared/run_query_text2.png '{"class": "image-lg image-framed"}')

## Run Query From Command Palette

1. To run the entire query, open the Command Palette and type **SFDX: Execute SOQL Query with Current File**. If you want to run a portion of your query, select a part of the query and type **SFDX: Execute SOQL query with Currently Selected Text** in the Command Palette.
2. Select one of these options depending on what your query does.
   - **REST API**: Performs operations on your org's data, such as creating an account or searching for contacts
   - **Tooling API**: Performs metadata and development-lifecycle tasks, such as getting test results or reading debug logs
3. The query results display in the output panel and a CSV file is created.

