Query Editor is a powerful tool that helps you build and execute SOQL queries easier. You can query large amounts of records at once, have multiple tabs open if you are using more than one query at the same time, save your most used queries so you can easily access them later, and quickly export the result to a .CSV file.
You can open the Query Editor by selecting it from the sidebar. Let's see what the Query Editor has to offer:
*For better user experience and performance datatable pagination is used, which means that queried records are split into smaller parts and not all rows will be shown at once. You can change number of rows for pagination in Settings.
Now that we showed you the basics of Query Editor, we can move on and create our first query. We'll start with this simple query on the account object:
SELECT Id, Name, Phone, Industry FROM Account LIMIT 100
As you can see, when you start typing a field, the Query Editor will immediately suggest fields from the object you used in the FROM part of the query. This can be very helpful and can save you a lot of time when typing your queries.
As you can see, the autofill adds a comma after each field is selected. You can execute the query without removing the last comma before the FROM part of the query. The comma will be automatically removed.
After typing your query, click 'Run' to execute it. The results should show up underneath. You can now sort your results by a certain column by clicking it's header. For example, here we've sorted our Accounts by Name:
In the result datatable, you can click on a record ID to open that record in the Record Data module. You can also click on the 'open external' icon in the ID column to open that record in Salesforce.
Additionally, in the upper right corner, you can check some additional information about the query: how many rows are in the result, what's it sorted by and when was it updated. There are also two new buttons that show up after you run your query. 'Create New' opens a New Record form in Salesforce for the object you queried for, while the 'Edit Object' button takes you to Salesforce setup to edit your current object.
If you want to filter your records, you can use the Search bar and search for a specific text. The results will be filtered to only show records that contain the typed in text (in any of the columns). Here, we've filtered our Accounts to only the records that contain the text 'media':
When you run your query, you can select records in the datatable, and then click the 'trash' icon under the 'Run' button to delete them from your org.
After the request has been processed, you will be able to see how many records have been deleted.
You can export successful deletions by clicking on Export success.csv, and unsuccessful deletions by clicking on Export error.csv.
To get the latest data, you will have to run the query again by clicking on Run.
Keep in mind that Salesforce allows deletion of up to 200 records in one API request. If you wish to delete more than 200 records at once, multiple API requests will have to be made.
When executing queries, sometimes you shift from one query to another very often. Sometimes you can accidentally close a query that you want to rerun. Sometimes you have some queries that you need to run often and you want them to be easily accessible. With Maven Tools installed, you can mark those problems as solved.
In the Query Editor, you can save your queries by clicking the 'Save' button in the upper right corner and naming your query.
The queries will be saved in your browser's local storage, so you can access them again every time you open Maven Tools.
To access your Saved queries, click the folder icon under the 'Save' button. You can also access your recently executed queries by clicking the icon on its left. Recent queries are saved for the duration of your current session and will be deleted once you exit Maven Tools.
You can export query results by clicking the export icon under the 'Run' button. Your records will then be exported to a .CSV (comma-seperated values) file and downloaded to your computer. You can then use that file to import the records to another Salesforce org.
Below the SOQL editor you can see the following bar with additional query settings:
After successful query execution you can quickly create a new record of the queried object in Salesforce by clicking Create New, and also access the object setup page by clicking Edit Object.
*When querying large amount of data with 'Fetch All' option enabled you can stop the query execution by clicking the 'Stop execution' button. All records retrieved up to that point will still be visible in the result datatable and can be exported.
Using the Maven Tools Query Editor you can build and execute any SOQL query just like in the Salesforce Developer Console. That means aggregated queries, relationship queries, and queries with additional options like ORDER BY, GROUP BY, HAVING. Additionally, with features like IntelliSense field suggestion, multiple tabs, and ability to save and use recent queries, Query Editor is a go-to tool for query execution. Read more about SOQL in the Salesforce Developer Documentation here.