Execute Other
When you click on the Execute
button, query module executes the query in default mode which is what you need more of the time. The default mode is,
query rest api, show only non-deleted records and fetch the first batch of records.
However, sometimes you want to execute a query with a variation. These variations are grouped as Execute Other
options. These options can be
accessed by clicking on the dropdown next to Execute
button as shown below
Note that some options are available only in certain editions, and if so, they would be mentioned in each of the sections below.
Execute and Fetch All
Brobench by default shows you the first batch of records matched by a Query. This is efficient and quick, so you can review the first batch of records and fetch more if required. However, in certain situations, you’re sure that you want to view all matched records, and in such cases, you can make use of this option.
While Query is executed and fetching records, it shows Cancel
button and if you cancel, it cancels fetching more batches and shows the records that
are fetched till then.
Execute with Include Deleted/Archived
This option executes the query to include the deleted records. Note that you can also query to include deleted records
using All Rows clause. Deleted records would be included when this option is selected or if query
has All Rows
clause hence you need not do both.
Execute in Conn
ProfessionalThis option allows you to execute a query in a different connection than the current one. Check out Cross Org Query for more info.
Execute as Count Query
Many times during the data analysis, you would want to see the count of records a query matches. You can do that in two
ways 1) Run the query as is and see the total records matched 2) Change the select clause to count()
and run the query
Both of them aren’t an efficient approach to get the records count. In the first case, it fetches the data
unnecessarily and might also keep the pagination cursor open on the server side. In second case, you need to change the
query to replace select fields with count()
and revert back to include fields afterward.
Execute as Count Query
option automates the second option. Upon execution, app replaces the select fields in memory
with count()
and shows the result.
Execute as Polymorphic Query
ProfessionalPolymorphic Field
is a field that can look up to more than one Object. For ex., Task.WhatId
, Event.WhatId
or Attachment.ParentId
etc.,
If you want to fetch related parent record information, you can’t use typical SOQL relationship names as those names may not be valid in all Objects that Poly Field can point to. Instead, you must use Poly Field clause in SOQL.
For ex.,
SELECT
TYPEOF What
WHEN Account THEN Phone, NumberOfEmployees
WHEN Opportunity THEN Amount, CloseDate
END
FROM Event
Brobench supports executing those queries fine. However, it is painful to construct such queries.
Execute as Polymorphic Query
automates construction of Type Of
clause behind the scene.
For ex., if you run select Id, What.Phone, What.NumberOfEmployess, What.Amount, What.CloseDate from Event
, via the
above option, app transform that query to above Type Of
clause and executes it.
Execute as Multi Conn Query
ProfessionalExecute as Multi Conn Query
allows you to execute the query against multiple connections, combine the results and show
all records in the grid with connection details. This is helpful if you want to view details of records
which are matched by common criteria across multiple connections. For ex., a Custom Setting value for the same name or
custom metadata value or User details for the same email etc.,
- The query you’re executing must be valid for all connections otherwise you will get an error message
- The grid adds two additional columns
Conn Name
andConn User
which shows the connection details - There is no
Query More
support for Multi Conn Query so it will fetch all records matched by the query - Record preview and view record links will work only for main connection records
- It supports Child Queries and similar to Parent Query, it adds
Conn Name
andConn User
columns
Video Guide
Usage
-
In the query editor or query builder, author the query you want to run, highlight the query text and then click on
Execute as Multi Conn Query
-
App shows the following dialog asking you to select one or more connections and click
Execute
. When you launch the below dialog for the first time in a session, it will select current connection by default. Afterward, it remembers the previously selected connections and selects them by default. -
App shows the results in the grid with connection details
-
You can sort, filter and group the results as usual including exporting the data
Execute via Bulk API
If you have a Query that matches a lot of records, it can take time to download all of those records via Batch API,
which is the default API that Brobench uses. Execute via Bulk API
, will change underlying api to Bulk API V2. App will
do all the heavy lifting behind the scene and shows the first batch of results, up to 50k. You can continue to fetch
the next batch of 50k records till results are exhausted.
Execute via Tooling Api
App automatically uses Tooling API if you’re querying a Sobject which is available only in Tooling API. However, there
may be objects that are available in both Partner Api and Tooling API, and in such cases, the app will use Partner API
by default. If you want to force the app to use Tooling Api, execute the query with Execute via Tooling Api
Execute Query in Clipboard
If you’ve copied a query from somewhere you want to execute, you don't need to paste into an editor, select and
execute it. Click on Execute Query in Clipboard
, which will save you some clicks.
Query Records by Ids in Clipboard
This is the same as Query Records by Ids which automatically uses the text in clipboard
Query Records by Ids
This option helps you view the records by set of ids or extracted ids from blob of the text. When you select this option, it shows the following dialog.
Enter ids or text containing ids and click View Records
. The app will extract the ids and view those records.
Please keep these points in mind when you use this feature.
- You can enter ids that belong to different objects. The app would group by the object and show multiple result tabs, one for each Object
- You can enter blob of text and in such cases, the app would try to extract the ids and show the result
Query Records by Ids in Clipboard
This action runs the Query currently in Clipboard so you don't have to paste the query into the editor, select it and run it.