Source and Limits (8 min)
Completion requirements
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](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/790027982/1_Report.png)
When to use the report option:
![example of a salesforce report](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/790027982/2_ReportExample%20%281%29.png)
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](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/790027982/3_Conditions.png)
Mapping: Use the Value dropdown to configure the report value. The column configuration options will be dependent on the value selected.
![salesforce configuration > mapping](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/790027982/4_Mapping.png)
Save and Preview. The table displays the text rating values as they display in Salesforce.
![preview of salesforce report in a power table](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/790027982/5_Preview.png)
![salesforce configuration](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/790027982/1_Report.png)
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.
![example of a salesforce report](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/790027982/2_ReportExample%20%281%29.png)
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](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/790027982/3_Conditions.png)
Mapping: Use the Value dropdown to configure the report value. The column configuration options will be dependent on the value selected.
![salesforce configuration > mapping](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/790027982/4_Mapping.png)
Save and Preview. The table displays the text rating values as they display in Salesforce.
![preview of salesforce report in a power table](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/790027982/5_Preview.png)
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](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/718958851/6_Apex.png)
The aggregated data is created in Salesforce. Here is the detailed breakdown of the apex class used in this example:
![apex classes in salesforce](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/718958851/7_ApexExample.png)
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](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/718958851/8_Apexname.png)
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](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/718958851/9_Parameters.png)
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](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/718958851/10_Mapping.png)
The table is inserted onto the canvas.
![inserted table](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/718958851/11_Table.png)
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](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/718958851/12_Pages.png)
2. Click the Static Variables tab and create a static variable using the Account ID. Click Apply.
![configure actions > static variable](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/718958851/13_Static.png)
Save and Preview. The name of the opportunity, the corresponding stage, and the aggregated discount count is displayed.
![preview of table](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/718958851/14_Preview.png)
![you apex option](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/718958851/6_Apex.png)
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).
![apex classes in salesforce](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/718958851/7_ApexExample.png)
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](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/718958851/8_Apexname.png)
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](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/718958851/9_Parameters.png)
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](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/718958851/10_Mapping.png)
The table is inserted onto the canvas.
![inserted table](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/718958851/11_Table.png)
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](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/718958851/12_Pages.png)
2. Click the Static Variables tab and create a static variable using the Account ID. Click Apply.
![configure actions > static variable](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/718958851/13_Static.png)
Save and Preview. The name of the opportunity, the corresponding stage, and the aggregated discount count is displayed.
![preview of table](https://academy.titandxp.com/pluginfile.php/947/mod_custompage/topics/718958851/14_Preview.png)