What is Workbench in Salesforce?
Workbench Salesforce Login
Below are the steps on how to connect Salesforce org with Workbench:
- Navigate to https://workbench.developerforce.com/ website.
- Select your environment as Production or Sandbox.
- Check the box ‘I agree to the Terms of Service’.
- Click ‘Login with Salesforce’ to connect to salesforce instance
- Once you click on Login then it will navigate to the salesforce login page. Please provide the Salesforce credentials username and password to connect workbench with salesforce instance then click Login.
- After login to Workbench Salesforce successfully then the pages allows Salesforce user to jump to different options like Standard and Custom Objects, Metadata Type and components, SOQL query, SOSL search, Insert, Update, Upsert, Delete, Insert, Undelete, Purge, deploy, retrieve and many more.
Workbench Menu bar
The system will navigate to the home page, Once you have successfully connected with salesforce. Also, Workbench has 5 sections of the menu bar on the top of the page as shown below which can help you perform different operations:
The details of each section and its operations are mentioned in the detail further in this post.
Workbench info consists of 3 sections: Standard and Custom Objects, Metadata types & Components, Session Information. Click on Info section on the top of the page and you will see 3 sections mentioned above
Standard and Custom Objects
Standard and Custom Objects sections in workbench provide the information of objects from the connected salesforce org like:
- Attributes: Information or parameter of the object detail like searchable, custom or standard object, etc.
- Child Relationships: Provides the information on all the child objects Relationship ID linked to the selected object.
- Fields: List of Fields and its details.
- Record Type Info: List of Record Types of the selected object and its detail.
- Supported Scope: Supported scope for an object like Account teams, my territory’s , etc.
Metadata types & Components
Workbench Session Information
System administrators can cancel user sessions in Salesforce. Session Information in Workbench displays details about current user session like Connection, Accessibility mode, profileId, Session seconds valid,user Email, user FullName, UserLocale, UserType and many more.
Queries Workbench Salesforce
Queries section of menubar allows user to perform SOQL Query, Async SOQL query ,SOSL search and Streaming Push Topics which helps to query the objects and get the data from the connected salesforce org.
SOQL Query Workbench Salesforce
In this section, you can select various objects and fields and apply a condition to build a SOQL query. You can view the records as a list or in a matrix form. Later, you can download it in a CSV format.
- Follow the steps menioned in ‘Workbench Salesforce Login‘ in the post to Login to Salesforce. Ignore this step if already logged in.
- Navigate to the Queries tab from the Menu bar and Select SOQL Query.
- Create a SOQL Query using Query builder or select an object and directly type the query in the query Section.
- Object: Select the object to query from the highlighted point 1 in the screenshot.
- View As: There are 4 options in View As:
- List: Shows the query result in the table format or list view.
- Matrix: There were Columns and Rows selections in old versions of a workbench; which are not available anymore and possibly the Matrix view is no more usable. however you can add the Group by Query like ‘ Select Status, LeadSource, COUNT(Name) cnt from Lead Group By ROLLUP (Status, Lead Source)’
- Bulk CSV: Use this option to query the data and then download the data in bulk in CSV format once the job is completed.
- Bulk XML: Use this option to query the data and then download the data in bulk in XML format once the job is completed.
- Sort and Filter: Select the field to sort the data ascending or descending. You can also add filter conditions to filter the data.
- Query: Workbench will build the query based on the Object, fields and the rest of the parameters selected.
- Query Results: Workbench will show the query result in the form of the list view, matrix view, etc selected in ‘View As’ once clicked on Search.
Async SOQL Query Workbench Salesforce
Async SOQL is a method for running SOQL queries in the background over Salesforce entity data. Use the Async SOQL API to run queries on big, standard, and custom objects. It provides the optimal way to process large amounts of data stored in Salesforce big objects.
Each query runs in the background, and by default, a single query can be executing at any given time. Results are written into an object that you specify, which can be an sObject or big object. As a result, you can subset, join, and create more complex queries that are not subject to timeout limits. Async SOQL is ideal when you have millions or billions of records, and need more scalable and more performant processing than is possible with synchronous SOQL.
For example, let’s say that you want to analyze the years and years of Lead’s history collected by Salesforce. The results could help you identify which current and future opportunities are more likely to close and give you a better picture of your forecast. But because the Lead’s history data is stored with all the field history data across the application, the volume of data is too large to query directly. That’s where Async SOQL comes in! You can use it to write a query that extracts a smaller, representative subset of the data that you’re interested. You can store this working dataset in a custom object and use it in reports, dashboards, or any other Lightning Platform feature.
Using Workbench for Async SOQL
For querying a large set of data and moving into a custom object to be used in reports, dashboards, etc. then Async SOQL can be used.
Note – You need to enable the Async SOQL feature otherwise you will get below error. Please note that ‘Async SOQL is included only with the licensing of additional big object capacity.’ For more details please refer to the salesforce website.
Difference Between Workbench & Dataloader
For any Data Manipulations in Salesforce, we have Data Loader. To update one or two records using Data loader, we HAVE to export .CSV file, modify the excel file and then load it. But in case of Workbench, we can update a single record; we only require the 15 digit UniqueId of the record and update the fields as required. This is one of the best functionality of Workbench as compared to Data loader.