In our previous posts we saw how to read and write Salesforce Data using SSIS. In this post we will see how to read Salesforce Metadata in SSIS using JSON Source. Later in this post we will show you how to integrate Salesforce data in Apps like Power BI, SSRS, Informatica and languages like C#, Java, Python or T_SQL for MS SQL Folks.
PrerequisitesBefore we perform steps listed in this article, you will need to make sure following prerequisites are met:
- SSIS designer installed. Sometimes it is referred as BIDS or SSDT (download it from Microsoft site).
- Basic knowledge of SSIS package development using Microsoft SQL Server Integration Services.
- Make sure ZappySys SSIS PowerPack is installed (download it).
- Optional (If you want to Deploy and Schedule ) - Deploy and Schedule SSIS Packages
Step-By-Step – Integrate in SSIS
In this section you will learn how to use ZappySys JSON Source Adapter to extract data from Salesforce REST API (JSON Format). You can call pretty much Any REST API to fetch data from salesforce but our example for this post would be read metadata (i.e. table list) from salesforce (we will call sobjects to get all table information) .
So lets get started.
- In case you missed the previous section, You need to Download and Install SSIS ZappySys PowerPack.
- Once you finished first step, Open Visual Studio and Create New SSIS Package Project.
- Now, Drag and Drop SSIS Data Flow Task from SSIS Toolbox.
- Double click on the Data Flow task to see Data Flow designer surface.
- From the SSIS toolbox drag and drop JSON Source on the Data Flow designer surface.
- Now double click JSON Source and enter your Report URL like below. Make sure you replace instance name and report ID as per the screenshot.
- Check Use Credentials and configure Salesforce Connection
- Configure your Salesforce connection
- Select or type filter. For example in this case you will type $.factMap.T!T.rows[*]
- Uncheck Use Parents option (You can keep it but it will add many unwanted fields)
- Now Go to Array Transform Tab
- Select Transform Type : Complex 2-dimensional array
- Column name filter: $.reportMetadata.detailColumns[*]
- Row values filter: $.dataCells[*].label
- Here is how your Array Transform Tab configuration should look like
- Now Click OK to Save UI and attach your source to some target like OLEDB Destination and run your data flow to test.
Step-By-Step – Reading Salesforce Custom Reports in ODBC Apps
So far we have seen how to read salesforce custom report data in SSIS using ETL approach, but what if you are not using SSIS and you want to pull data in programming languages like C#, Java, Python or apps like Power BI, Informatica, Excel, SSRS or using pure T-SQL way in SQL Server?
RequirementsIn order to access API data inside your App using ODBC Driver you will need to make sure following requirements are met.
- Download and Install ZappySys ODBC PowerPack (This includes XML / JSON / REST API and few other drivers for SQL Server and ODBC connectivity in tools like Excel, Power BI, SSRS)
ZappySys Provides native Salesforce Driver to read / write Salesforce Object’s data (Its part of ODBC PowerPack). This driver can read/write standard objects (e.g. Accounts, Contacts) However reading from salesforce custom report is not supported by native driver. For this purpose you have to use JSON / REST Driver using this approach. With Generic REST / JSON API driver you can automate pretty much any Salesforce Operations. To get some advanced information on Report API you can refer this guide
So let’s get started.
- Follow this blog post to install JSON / REST Driver and configure Salesforce OAuth Connection.
- Once you can read some sample data described in previous step we are ready to run advanced queries.
- Go to Preview Tab and Run below Query to pull data from Custom Report
Transact-SQL12345678910--change YOUR-INSTANCE and YOUR-REPORT-IDSELECT * FROM $WITH(Src='https://YOUR-INSTANCE.salesforce.com/services/data/v39.0/analytics/reports/YOUR-REPORT-ID',Filter='$.factMap.T!T.rows[*]',ArrayTransformType='TransformComplexTwoDimensionalArray',ArrayTransColumnNameFilter='$.reportMetadata.detailColumns[*]',ArrayTransRowValueFilter='$.dataCells[*].label',RequestMethod='GET')
Integrate Salesforce Data in ODBC Apps (e.g. Power BI, SSRS, Excel, Informatica, Access, C#…)
BI / Reporting Tools Integration
|ETL Tools Integration||Programming Languages Integration|
In this post we saw how easy it is to perform Salesforce Data Integration in SSIS or any other apps using ZappySys SSIS Connectors or ODBC Drivers. Download FREE Trial of SSIS PowerPack or if you need to integration in other apps then get ODBC PowerPack here