Overview: Query Builder for Salesforce CRM

With the Query Builder for Salesforce CRM, you can create Custom Salesforce Metrics using a combination of Metrics, Dimensions, and Filters. 

HOW TO

How to access the Query Builder for Salesforce

Navigate to  Metrics > Query Builder to access the Query Builder for Salesforce. Click the green + Create Custom Metric button and select your connected Salesforce Account from the Data Source drop-down list.

    Query Builder is available on Professional and Performer plans. Request a trial of Query Builder by following these steps  

How to use the Query Builder for Salesforce

The Query Builder for Salesforce is unique in that it allows you to use the Databox Query Builder or Salesforce Object Query Language (SOQL) to create Custom Metrics. 

IN THIS SECTION

Query Builder

A
  Data Source: This is the Salesforce CRM Data Source from which the Custom Metric is syncing data.  
B
  Object: Select an Object from your Salesforce Data Source, such as "Account," "Lead," or "Opportunity." This selection determines where the data is being synced from the Salesforce Account and what data is included in the returned Custom Metric value.
C
  Aggregation Function: The Aggregation Function field determines how the system will handle multiple results that are returned from the Salesforce CRM Account. You can choose between  SUM, MIN, MAX, AVG, and  Count.

For example, if you create a Custom Metric called "New Leads," you'd want to select  Lead ID as the Metric and Count as the Aggregation Function. This will make it so each Lead ID that is returned from the Salesforce Account will simply be counted as one (+1). 

D
  Data Type: The Data Type ensures that your Custom Metrics will be synced correctly in Databox. 
Period Values is the predefined Data Type. The Custom Metric will reflect the most up-to-date value for a specific period. (day, month, week). Learn more about Data Types here.  
E

  Period: Select the Period that you want to see the aggregated metric value for. You can choose between Hour, Day, Week, Month, Quarter, and Year.

For longer Date Ranges, individual metric values will be aggregated for the entire Date Range, and the aggregated value will be displayed for the metric.

F

  Advanced metric definition: In the Advanced metric definition window, you can set a description for a Custom Metric, set Favourable Trend of the metric (Trending up is positive or Trending down is positive), and other additional advanced settings to a metric. Learn more here.

G
  Preview data: After clicking Preview data, a Data Preview of the Custom Metric will be displayed. Daily Metric values are displayed in this section, along with the total Metric values for the Date Range in bold at the bottom. You can view the Data Preview for different Date Ranges by clicking on the drop-down list at the top of the Data Preview. 
H
   Custom Metric Name: Enter a name for your Custom Metric. This Custom Metric name will be available in the Designer after saving. 
I
   Save: Save your Custom Metric. 

SOQL Query

A
  Data Source: This is the Salesforce CRM Data Source that the Custom Metric is syncing data from.  
B
  SOQL: Construct query strings to access your Salesforce data using Salesforce Object Query Language (SOQL). SOQL is similar to the SELECT statement used in Structured Query Language (SQL), but it is designed specifically for Salesforce data. 
Learn more about SOQL here
C
  Aggregation Function: The Aggregation Function field determines how the system will handle multiple results that are returned from the Salesforce CRM Account. You can choose between Latest, SUM, MIN, MAX, AVG, and Count.
For example, if you create a Custom Metric called "New Leads," you'd want to select  Lead ID as the Metric and  Count as the  Aggregation Function. This will make it so each Lead ID that is returned from the Salesforce Account will simply be counted as one (+1). 
D
  Data Type: The Data Type ensures that your Custom Metrics will be synced correctly in Databox. 
All Values is the predefined Data Type. 
For this Data Type, Custom Metrics with  Latest selected as the  Aggregation Function will show the most recently synced value in Databox. Custom Metrics with any other Aggregation Function selected (i.e., SUM, MIN, MAX, AVG, Count) will show individual Metric Value(s) for the specified Date/ Timestamp. For longer Date Ranges, individual Metric Values will be aggregated for the entire Date Range and the aggregated Value will be displayed for the Custom Metric. 

Learn more about Data Types here.  

E

  Advanced metric definition: In the Advanced metric definition window you can set a description for a Custom Metric, set Favourable Trend of the metric (Trending up is positive or Trending down is positive), and other additional advanced settings to a metric. Learn more here.

F
  Preview data: After clicking  Preview data, a Data Preview of the Custom Metric will be displayed. Daily Metric values are displayed in this section, along with the total Metric values for the Date Range in bold at the bottom. You can view the Data Preview for different Date Ranges by clicking on the drop-down list at the top of the Data Preview. 
G
  Custom Metric Name: Enter a name for your Custom Metric. This Custom Metric name will be available in the Designer after saving. 
H
  Save: Save your Custom Metric. 

How to create a Custom Salesforce Metric [Example]

In this example, we'll create a Custom Metric to report on New Opportunities.

1
 Navigate to Metrics > Query Builder   
2
 Click the green + New query button
3
 Select the appropriate Salesforce CRM Data Source
4
  We'll build this Custom Metric using the Databox Query Builder, so we'll select the Builder button
5
 We want to report on Opportunities, so we'll choose Opportunity as the Object. This will ensure we're syncing data from the appropriate place in the Salesforce Account
6
 We want all Metric values added together, so we'll select SUM as the Aggregation Function
7
 The Data Type, Period  Values, is auto-selected
8
  We want to aggregate metric values by days, so we'll select Day as Period
9
 To accurately explain what this Custom Metric is reporting on, we'll name the Custom Metric "New Opportunity" 
10
 Click Preview data to generate a Data Preview of the Custom Metric  
11
 Once we confirm that these are the results we're looking for, we'll click Save to save the Custom Metric

How to add a Custom Salesforce Metric to a Databoard

1
 Open the selected Databoard in the Databox Designer or create a new Databoard.
2
 Drag and drop a blank Datablock onto the Databoard from the Visualization Library. 
3
 Select the appropriate Salesforce Data Source in the righthand Property Manager. It must be the same Salesforce Account that was selected when creating the Custom Metric. 
4
 Select the  Custom tab at the top of the  Metric drop-down list. 
5
 Select the Custom Metric name to populate the Datablock.

Additional Information

  • If you receive an error message saying "errorCode: MALFORMED_QUERY" when using a Filter, add single quotes (' ') around the Filter in the Value field.
  • Dates must be entered with the following format: YYYY-MM-DD
  • SOQL results are limited to 10,000 rows. If you expect your query to return over 10,000 rows or if you're not sure how many rows will be returned, be sure to LIMIT the query. If you need more than 10,000 rows in order to report on your Salesforce CRM data in Databox successfully, you can to submit your request on our Roadmap here.
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.