This lesson will cover the following topics:

02 | Report
03 | Apex

01 Getting Started

This tutorial covers configuring a source using Power Tables' report and apex options and where data can be pulled from in Salesforce.

02 Report

In order to query a report, as the integration user, you need to have recently accessed the report. If you do not see the report in the Source in Salesforce drop-down. Navigate to your Salesforce account and view the report, the report will now display in the list.
salesforce configuration

When to use the report option:
  • You can query more records. 
  • A report can contain data from several objects or calculated data that a simple table cannot.
For example, this report has text-based rating values based on the amount using a formula. You can display the rating values without having to complete additional configuration.
example of a salesforce report

Conditions: You can choose to not configure any conditions when using a report and pull in all information from the report. This is useful as reports will already have specific filtered information.
salesforce configuration > conditions

Mapping: Use the Value dropdown to configure the report value. The column configuration options will be dependent on the value selected.
salesforce configuration > mapping

Save and Preview. The table displays the text rating values as they display in Salesforce.
preview of salesforce report in a power table

03 Apex

Use the Apex option when bringing advanced calculations, multiple objects, and large number of records.  For our example, bring in the advanced calculation - aggregated data
you apex option
The aggregated data is created in Salesforce. Here is the detailed breakdown of the apex class used in this example:
  • We bring opportunities for a specific account.
  • Then aggregate the results to sum up the number of discounts on the opportunity line item for each opportunity
  • The data must display the number of discounts per opportunity (of the aggregated line items).
By using a power table, this data will be displayed in an organized way. The string values displayed will be used to configure the table.
apex classes in salesforce
1. Copy the name of the Apex Class in Salesforce and paste the name into the Source in Salesforce field. Click Next.
copy and paste apex name
2. Using the strings from the Apex data, configure the parameters of your table. For example, the account ID must equal the account ID field. Click Next.
salesforce configuration > parameters
3. Insert the Source Value text. This should be copied directly from your apex to ensure the strings are identical, this also applies to each of your table columns. Configure your column names by manually adding the data. Click Apply.
salesforce configuration > mapping
The table is inserted onto the canvas.
inserted table
To check the configuration of the table, an account ID was copied from Salesforce and used to populate a static variable . To complete this step:
1. Open the Pages drop-down, select the kebab menu next to a project page, and click configure actions from the sub-menu.
pages drop down > kebab menu > configure actions button
2. Click the Static Variables tab and create a static variable using the Account ID. Click Apply.
configure actions > static variable
Save and Preview. The name of the opportunity, the corresponding stage, and the aggregated discount count is displayed.
preview of table

04 Got Feedback?

Additional Resources