<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>salesforce Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/tag/salesforce/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/tag/salesforce/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Wed, 21 Jan 2026 22:44:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.4</generator>

<image>
	<url>https://zappysys.com/blog/wp-content/uploads/2023/01/cropped-zappysys-symbol-large-32x32.png</url>
	<title>salesforce Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/tag/salesforce/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to query salesforce data using Bulk API in SSIS</title>
		<link>https://zappysys.com/blog/query-salesforce-data-using-bulk-api-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Thu, 20 Jan 2022 19:07:09 +0000</pubDate>
				<category><![CDATA[SSIS CSV Source]]></category>
		<category><![CDATA[SSIS Salesforce API Task]]></category>
		<category><![CDATA[SSIS Salesforce Connection]]></category>
		<category><![CDATA[bulk api]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[Regular Expression]]></category>
		<category><![CDATA[salesforce]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=9507</guid>

					<description><![CDATA[<p>Introduction In our previous post, we saw how to read Salesforce data using SSIS Salesforce Source (Which uses SOAP API under the hood). This may be slow if you have millions of rows because Salesforce Source paginates every 2000 rows, so it&#8217;s not a good option to read millions of rows to iterate on a [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/query-salesforce-data-using-bulk-api-ssis/">How to query salesforce data using Bulk API in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In our previous post, we saw how to <a href="https://zappysys.com/blog/export-data-from-salesforce-to-sql-server-using-ssis/" target="_blank" rel="noopener">read Salesforce</a> data using SSIS Salesforce Source (Which uses SOAP API under the hood). This may be slow if you have millions of rows because Salesforce Source paginates every 2000 rows, so it&#8217;s not a good option to read millions of rows to iterate on a large Salesforce dataset (Table or Query). To increase the read speed, you can use BULK API. This article explains how to read salesforce data using BULK API and increase read speed.</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2>NEW Version (v5.5+)</h2>
<p>In the new version (v5.5), we have added an option to query in Bulk Mode. This means if you have millions of Salesforce object rows to read, no worries; it may be very fast in the new version. Previously, it used to take a long time because it read in batches of 2000 rows in each request. With the Bulk API, the batch size is really large.</p>
<p>Here is how to set Salesforce Bulk API Mode in SELECT query (Read operation).</p>
<ol>
<li>Install new version of SSIS PowerPack. Make sure it is v5.5 or higher.</li>
<li>Open existing Salesforce Source UI</li>
<li>Make sure you <strong>check [Use Bulk API]</strong> option like below. if you do not see this option then most likely you are using older version.<br />
-OR-<br />
Just add <strong>#bulkmode</strong> prefix in the SQL query like below, it will use Bulk API</p>
<div id="attachment_11114" style="width: 687px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-bulk-api-option-soql-select-query.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-11114" class="size-full wp-image-11114" src="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-bulk-api-option-soql-select-query.png" alt="" width="677" height="585" srcset="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-bulk-api-option-soql-select-query.png 677w, https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-bulk-api-option-soql-select-query-300x259.png 300w" sizes="(max-width: 677px) 100vw, 677px" /></a><p id="caption-attachment-11114" class="wp-caption-text">Bulk API mode for SSIS Salesforce Source (Read Large amount of data using SOQL Query)</p></div></li>
</ol>
<h2>OLD Version</h2>
<p>If you are using an older version of SSIS Power Pack (v5.4.0 or older), you can follow the steps mentioned in the following section.</p>
<p>We will see how to query using Salesforce Bulk API in SSIS. It involves three simple steps like the one below.</p>
<ol>
<li>Call BULK API &#8211; Submit SOQL Query and receive a JobId back (Use <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-api-task/">SSIS Salesforce API Task</a>)<br />
<pre class="crayon-plain-tag">https://{your-instance}.salesforce.com/services/data/v50.0/jobs/query</pre>
</li>
<li>Keep checking Job Status Until Status is <strong>JobComplete</strong> (Use <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-api-task/">SSIS Salesforce API Task</a>)<br />
<pre class="crayon-plain-tag">https://{your-instance}.salesforce.com/services/data/v50.0/jobs/query/{{User::JobId}}</pre>
</li>
<li>Read Query Result  (Use <a href="https://zappysys.com/products/ssis-powerpack/ssis-csv-file-source-flat-file-web-api/" target="_blank" rel="noopener">SSIS CSV Source</a>)<br />
<pre class="crayon-plain-tag">https://{your-instance}.salesforce.com/services/data/v50.0/jobs/query/{{User::JobId}}/results</pre>
</li>
</ol>
<div id="attachment_9515" style="width: 671px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-query-bulk-api-read-data.png"><img decoding="async" aria-describedby="caption-attachment-9515" class="size-full wp-image-9515" src="https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-query-bulk-api-read-data.png" alt="Query Salesforce Data using Bulk API in SSIS (read using SOQL query in Bulk mode / large dataset)" width="661" height="330" srcset="https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-query-bulk-api-read-data.png 661w, https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-query-bulk-api-read-data-300x150.png 300w" sizes="(max-width: 661px) 100vw, 661px" /></a><p id="caption-attachment-9515" class="wp-caption-text">Query Salesforce Data using Bulk API in SSIS (read using SOQL query in Bulk mode / large dataset)</p></div>
<p>Now, let&#8217;s look at everything in detail.</p>
<h3>Obtain Salesforce Credentials</h3>
<p>The first step to call Salesforce API is to obtain credentials (security token or OAuth ClientId /Secret)</p>
<p>Method#1 &#8211; Check <a href="https://zappysys.com/blog/export-data-from-salesforce-to-sql-server-using-ssis/#Get_Salesforce_Security_Token">this article</a> to use <strong>UserId/ Password / SecretToken</strong><br />
Method#2 &#8211; Check <a href="https://zappysys.com/blog/register-salesforce-app-obtain-client-id-secret-oauth-api-call/">this article</a> to use the <strong>OAuth</strong> Connection Option</p>
<h3>Create Salesforce Connection</h3>
<p>Once we have Salesforce Credentials, we can create a new Salesforce Connection (You can do this from Task UI or the below way)</p>
<ol>
<li>Open Visual Studio ( Assuming you already have SSIS installed along with <a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">ZappySys PowerPack</a> )</li>
<li>Create a New SSIS Package Project.</li>
<li>Right-click on the Connection Manager panel and click on New Connection.<br />
<img decoding="async" class="figureimage" title="SSIS Create New Connection" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/ssis-new-connection.png" alt="SSIS Create New Connection" /></li>
<li>Select <strong>ZS-SALESFORCE</strong> Connection Manager from the Connection Managers list and Click on the Add Button.<br />
<img decoding="async" class="figureimage" title="SSIS Salesforce Connection Manager - ADD" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/salesforce-connection/ssis-salesforce-api-task-connection-1.png" alt="SSIS Salesforce Connection Manager - ADD" /></li>
<li>Now in Connection Manager UI, Enter your SalesForce Credentials (OAuth Client Id/. Secret &#8211;or&#8212; User Name, Password and Security Token), and leave all other properties as it is.<br />
<img decoding="async" class="figureimage" title="SSIS Salesforce Connection Manager UI " src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/salesforce-connection/ssis-salesforce-connection-manager-ui.png" alt="SSIS Salesforce Connection Manager UI " /></li>
</ol>
<h3>Call Create Job &#8211; Retrieve / Save JobId</h3>
<p>Once the connection is created, we can create our first step. Basically, we will call this API to <a href="https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/query_create_job.htm" target="_blank" rel="noopener">create Job</a> (Bulk Read)</p>
<ol>
<li>Here, in Visual Studio, drag and drop the ZS Salesforce API Task on the design surface.<img decoding="async" class="figureimage" title="SSIS Salesforce API Task - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/salesforce-api-task/ssis-salesforce-api-task-drag.png" alt="SSIS Salesforce API Task - Drag and Drop" /></li>
<li>Double click the Task and configure Request Settings Tab like below<br />
&#8211; Select Salesforce Connection (Created in the previous section)<br />
&#8211; Check <strong>Use direct URL</strong><br />
&#8211; Enter URL like below (Replace <strong>{your-instance}</strong> with your own instance (i.e. na9) . For more information on how to find out my<br />
salesforce instance id <a href="https://help.salesforce.com/s/articleView?id=000322728&amp;type=1">check this article</a><br />
<pre class="crayon-plain-tag">https://{your-instance}.salesforce.com/services/data/v50.0/jobs/query</pre>
&#8211; Request Method <strong>POST</strong><br />
&#8211; Enter Body like below (You can use your own <a href="https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm" target="_blank" rel="noopener">SOQL query</a>). Keep in mind SQOL must be <a href="https://www.freeformatter.com/json-escape.html" target="_blank" rel="noopener">encoded for JSON format</a>. This means the entire SQL must be in one line (replace new lines with \r\n , quotes with \&#8221; and tabs with \t)<br />
For example, to execute SELECT Id, Name FROM Accounts, you can write something like the one below in BODY.<br />
<pre class="crayon-plain-tag">{
  "operation": "query",
  "query": "SELECT Id, Name\r\nFROM Account"
}</pre>
The above is for below (with a new line)<br />
<pre class="crayon-plain-tag">SELECT Id, Name
FROM Account</pre>
<div id="attachment_9516" style="width: 690px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-call-salesforce-bulk-api-query-soql-sql.png"><img decoding="async" aria-describedby="caption-attachment-9516" class="size-full wp-image-9516" src="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-call-salesforce-bulk-api-query-soql-sql.png" alt="Create Job - Call Bulk API to Read / Query using SOQL" width="680" height="547" srcset="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-call-salesforce-bulk-api-query-soql-sql.png 680w, https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-call-salesforce-bulk-api-query-soql-sql-300x241.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></a><p id="caption-attachment-9516" class="wp-caption-text">Create Job &#8211; Call Bulk API to Read / Query using SOQL</p></div></li>
<li>Now Click Test Request (Copy the <strong>JobId</strong> which we will use in the Variable for Designtime Testing)</li>
<li>On the Response Tab, configure it like the below.<br />
&#8211; Select Response content Type = Json<br />
&#8211; Enter <strong>$.id</strong> as the expression<br />
&#8211; Check Save response option<br />
&#8211; Select Save to Variable and click New to create a variable. Name it <strong>JobId</strong> and enter a sample <strong>JobId</strong> value (copied from the previous step)</p>
<div id="attachment_9517" style="width: 459px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-call-salesforce-bulk-api-extract-jobid-from-result.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9517" class="size-full wp-image-9517" src="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-call-salesforce-bulk-api-extract-jobid-from-result.png" alt="Extract Salesforce JobId save to SSIS Variable" width="449" height="236" srcset="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-call-salesforce-bulk-api-extract-jobid-from-result.png 449w, https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-call-salesforce-bulk-api-extract-jobid-from-result-300x158.png 300w" sizes="(max-width: 449px) 100vw, 449px" /></a><p id="caption-attachment-9517" class="wp-caption-text">Extract Salesforce JobId save to SSIS Variable</p></div></li>
</ol>
<h3>Do Status Check &#8211; Look for JobComplete</h3>
<p>Once we create a job and store JobId in the variable we have to keep <a href="https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/query_get_one_job.htm" target="_blank" rel="noopener">checking Job status</a> every X seconds. Don&#8217;t worry you don&#8217;t have to use Loop or timer control for that. ZappySys made it so simple to check such thing without Loop /Timer.</p>
<ol>
<li>Drag and drop the ZS Salesforce API Task in the design surface.<img decoding="async" class="figureimage" title="SSIS Salesforce API Task - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/salesforce-api-task/ssis-salesforce-api-task-drag.png" alt="SSIS Salesforce API Task - Drag and Drop" /></li>
<li>Double click and configure like below. URL will be different this time. Use variable as below and replace your instance ID<br />
<pre class="crayon-plain-tag">https://{your-instance}.salesforce.com/services/data/v50.0/jobs/query/{{User::JobId}}</pre>
<div id="attachment_9518" style="width: 720px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-api-job-status-check.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9518" class="size-full wp-image-9518" src="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-api-job-status-check.png" alt="Check Salesforce Job Status Periodically (Without Loop + Timer Controls) " width="710" height="566" srcset="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-api-job-status-check.png 710w, https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-api-job-status-check-300x239.png 300w" sizes="(max-width: 710px) 100vw, 710px" /></a><p id="caption-attachment-9518" class="wp-caption-text">Check Salesforce Job Status Periodically (Without Loop + Timer Controls)</p></div></li>
<li>Now go to the Status Check Tab and configure it, as shown below. It will keep looking for the words below in the response to decide whether it is a Success or Failure. If those words are not found, they will be checked every 5 seconds (Maximum 1200 secs).<br />
&#8211; Check Enable Status Check option<br />
&#8211; For Success Value &#8211; Enter <strong>JobComplete</strong><br />
-Check Fail task option<br />
&#8211; Enter <strong>Cancel|Failed|Abort</strong> in the text box</p>
<div id="attachment_9519" style="width: 709px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-api-job-status-check-2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9519" class="size-full wp-image-9519" src="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-api-job-status-check-2.png" alt="Configure Job Status Check Loop using Salesforce API Task" width="699" height="640" srcset="https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-api-job-status-check-2.png 699w, https://zappysys.com/blog/wp-content/uploads/2022/01/ssis-salesforce-api-job-status-check-2-300x275.png 300w" sizes="(max-width: 699px) 100vw, 699px" /></a><p id="caption-attachment-9519" class="wp-caption-text">Configure Job Status Check Loop using Salesforce API Task</p></div></li>
</ol>
<h2></h2>
<h3>Read data (Compressed CSV Format)</h3>
<p>Last step is <a href="https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/query_get_job_results.htm" target="_blank" rel="noopener">read the result</a> from completed Salesforce Job. Its in CSV format so we will use Advanced <a href="https://zappysys.com/products/ssis-powerpack/ssis-csv-file-source-flat-file-web-api/" target="_blank" rel="noopener">SSIS CSV Source</a> which supports API connection to Salesforce. For that, we will use the same Salesforce API Task used before.</p>
<ol>
<li>Drag and Drop SSIS Data Flow Task from SSIS Toolbox.<br />
<img decoding="async" class="figureimage" title="SSIS Data Flow Task - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/drag-and-drop-data-flow-task.png" alt="SSIS Data Flow Task - Drag and Drop" /></li>
<li>Double click on the DataFlow task to see DataFlow designer surface.</li>
<li>Here, In Visual Studio, drag and drop the ZS CSV Source (Web API or File) in the design panel<br />
<img decoding="async" class="figureimage" title="SSIS CSV Source (Web API or File) - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-source/ssis-csv-file-source-drag.png" alt="SSIS CSV Source (Web API or File) - Drag and Drop" /></li>
<li>Double click on ZS CSV Source (Web API or File) Configure it like below.<br />
&#8211; Enter URL to read result like this (You can supply OPTIONAL maxRecords parameters to control how much data comes in a single response)<br />
<pre class="crayon-plain-tag">https://{your-instance}.salesforce.com/services/data/v50.0/jobs/query/{{User::JobId}}/results
--OR--
https://{your-instance}.salesforce.com/services/data/v50.0/jobs/query/{{User::JobId}}/results?maxRecords=50000</pre>
&#8211; Check Use Credentials and select Salesforce Connection<br />
&#8211; Click Preview (assuming JobId variable has a valid completed JobId)</p>
<div id="attachment_9520" style="width: 689px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2022/01/read-salesforce-data-bulk-api-csv-result.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9520" class="size-full wp-image-9520" src="https://zappysys.com/blog/wp-content/uploads/2022/01/read-salesforce-data-bulk-api-csv-result.png" alt="Read Salesforce Bulk API Job Result - Using SSIS CSV / API Source" width="679" height="663" srcset="https://zappysys.com/blog/wp-content/uploads/2022/01/read-salesforce-data-bulk-api-csv-result.png 679w, https://zappysys.com/blog/wp-content/uploads/2022/01/read-salesforce-data-bulk-api-csv-result-300x293.png 300w" sizes="(max-width: 679px) 100vw, 679px" /></a><p id="caption-attachment-9520" class="wp-caption-text">Read Salesforce Bulk API Job Result &#8211; Using SSIS CSV / API Source</p></div></li>
<li>Now, set up Pagination as below to read all records using an automated loop. You will need <strong>VERSION Released after Jun 20, 2022</strong> to use Regular Expression feature in Header Value extractionBy default, Salesforce doesn&#8217;t send all records in response so we <a href="https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/#Method-7_REST_APIPagination_using_Cursor_Continuation_Token_from_Response_Header" target="_blank" rel="noopener">need to setup pagination</a>. In below example we are reading <strong>Sforce-Locator</strong> attribute from Response and sending it to the next URL as <strong>locator=&lt;continue-token&gt;</strong> value<br />
&#8211; Choose <strong>Response Header Contains Continue Token </strong><br />
&#8211; Enter below expression in <strong>Page Num Indicator</strong><br />
<pre class="crayon-plain-tag">locator=Sforce-Locator(^((?!null\b).)*$)</pre>
Basically, the above expression will keep looping until we find <strong>Sforce-Locator : null</strong> in the response header.</p>
<div id="attachment_9723" style="width: 872px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-bulk-query-api-pagination-read-csv-data.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9723" class="size-full wp-image-9723" src="https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-bulk-query-api-pagination-read-csv-data.png" alt="Pagination for Salesforce Bulk Query API (Get Header Value from Sforce-Locator)" width="862" height="523" srcset="https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-bulk-query-api-pagination-read-csv-data.png 862w, https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-bulk-query-api-pagination-read-csv-data-300x182.png 300w, https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-bulk-query-api-pagination-read-csv-data-768x466.png 768w" sizes="(max-width: 862px) 100vw, 862px" /></a><p id="caption-attachment-9723" class="wp-caption-text">Pagination for Salesforce Bulk Query API (Get Header Value from Sforce-Locator)</p></div></li>
<li>Click OK to save and now run entire package like below.</li>
</ol>
<div id="attachment_9515" style="width: 671px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-query-bulk-api-read-data.png"><img decoding="async" aria-describedby="caption-attachment-9515" class="size-full wp-image-9515" src="https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-query-bulk-api-read-data.png" alt="Query Salesforce Data using Bulk API in SSIS (read using SOQL query in Bulk mode / large dataset)" width="661" height="330" srcset="https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-query-bulk-api-read-data.png 661w, https://zappysys.com/blog/wp-content/uploads/2022/01/salesforce-query-bulk-api-read-data-300x150.png 300w" sizes="(max-width: 661px) 100vw, 661px" /></a><p id="caption-attachment-9515" class="wp-caption-text">Query Salesforce Data using Bulk API in SSIS (read using SOQL query in Bulk mode / large dataset)</p></div>
<h2>Conclusion</h2>
<p>In this article we saw how to use various ZappySys Components / Task to achieve complex Salesforce API calls to read Query data using Bulk API. Download <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a> and try yourself and also explore 70+ other tasks /components not discussed in this article.</p>
<p>The post <a href="https://zappysys.com/blog/query-salesforce-data-using-bulk-api-ssis/">How to query salesforce data using Bulk API in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to register Salesforce App and obtain Client ID / Secret (for API Call / OAuth)</title>
		<link>https://zappysys.com/blog/register-salesforce-app-obtain-client-id-secret-oauth-api-call/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Mon, 27 Dec 2021 20:40:45 +0000</pubDate>
				<category><![CDATA[Salesforce Driver]]></category>
		<category><![CDATA[SSIS Salesforce Connection]]></category>
		<category><![CDATA[SSIS Salesforce Destination]]></category>
		<category><![CDATA[SSIS Salesforce Source]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[odbc]]></category>
		<category><![CDATA[salesforce]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=9482</guid>

					<description><![CDATA[<p>Introduction Using Salesforce Connection with OAuth App in SSIS / ODBC Once you have Client ID / Secret, you can use it in the Salesforce Connection in SSIS Connector / ODBC Driver for Salesforce like below (Only the new version will have OAuth option) Troubleshooting Known Issues Let&#8217;s look at some common issues with Salesforce [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/register-salesforce-app-obtain-client-id-secret-oauth-api-call/">How to register Salesforce App and obtain Client ID / Secret (for API Call / OAuth)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<div class="content_block" id="custom_post_widget-9476">In this section, we will discuss how to register OAuth App to call Salesforce API using Client ID / Secret rather than using your User Id / Password.

Once you follow these steps below to register your Salesforce App (OAuth App), at the end you will get a Client ID (sometimes referred to as App Id) and Client Secret (or App Secret). These two pieces can be used later on to call Salesforce API using OAuth.

So let's get started.
<h3>Register Salesforce App (OAuth)</h3>
<ol>
 	<li>Login into your account and go to <strong><em>Setup</em> </strong>as shown below (click on gear icon at the top right corner):
<img loading="lazy" decoding="async" src="https://zappysys.zendesk.com/attachments/token/7D9Rx9qHJswkt28sC5vTggrNT/?name=inline-1178316509.png" alt="Accessing Salesforce Setup to create an OAuth App" width="342" height="233" data-original-height="233" data-original-width="342" /></li>
 	<li>Then in the search bar input "app" and open <strong><em>App Manager</em></strong>:
<img loading="lazy" decoding="async" src="https://zappysys.zendesk.com/attachments/token/DTjFQpyDw4NViKdJyhyFkO1ng/?name=inline1698967483.png" alt="Searching Salesforce App Manager to create an OAuth App" width="689" height="364" data-original-height="364" data-original-width="689" /></li>
 	<li>Then click <strong><em>New Connected App</em></strong> to create a new OAuth App:
<strong>NOTE:</strong> In some version, it may say <strong><strong>New External Client App
</strong></strong>
<p data-start="1271" data-end="1309">Look for one of the following buttons:</p>

<ul data-start="1310" data-end="1395">
 	<li data-start="1310" data-end="1348">
<p data-start="1312" data-end="1348"><strong data-start="1312" data-end="1333">New Connected App</strong> (Classic name)</p>
</li>
 	<li data-start="1349" data-end="1395">
<p data-start="1351" data-end="1395"><strong data-start="1351" data-end="1378">New External Client App</strong> (Lightning name)</p>
</li>
</ul>
<img loading="lazy" decoding="async" src="https://zappysys.zendesk.com/attachments/token/eD6OrA9TqfRuM5N41Vqd7nrvb/?name=inline684283902.png" alt="Creating a Salesforce App to get data via ODBC driver" width="867" height="327" data-original-height="327" data-original-width="867" /></li>
 	<li>Give your App a name and:
- Enable OAuth Settings
- Set callback URL to following two URLs (one in each line)
<strong><em>https://login.salesforce.com/services/oauth2/success
</em></strong><em><strong>https://zappysys.com/oauth</strong></em>
- Add an OAuth scope you want or simply add "<strong><em>Full access</em></strong>".
- Add "<strong><em>Perform requests on your behalf at any time (offline_token)</em></strong>" scope to get a refresh token so that you don't have to re-authenticate each time requesting an access token:<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/create-salesforce-connected-oauth-app-for-odbc-datasource.png"><img loading="lazy" decoding="async" class="wp-image-4267 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/create-salesforce-connected-oauth-app-for-odbc-datasource.png" alt="Configuring Salesforce App OAuth settings to get data via ODBC driver" width="1041" height="700" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/create-salesforce-connected-oauth-app-for-odbc-datasource.png 1041w, https://zappysys.com/blog/wp-content/uploads/2018/06/create-salesforce-connected-oauth-app-for-odbc-datasource-300x202.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/create-salesforce-connected-oauth-app-for-odbc-datasource-768x516.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/06/create-salesforce-connected-oauth-app-for-odbc-datasource-1024x689.png 1024w, https://zappysys.com/blog/wp-content/uploads/2018/06/create-salesforce-connected-oauth-app-for-odbc-datasource-272x182.png 272w" sizes="(max-width: 1041px) 100vw, 1041px" /></a>

<span style="text-decoration: underline; color: #800000;"><strong>IMPORTANT:</strong></span> You can use "<strong>Access and manage your data (api)</strong>" if you do not like to grant full permission to this app but make sure you request same permission from the caller app too  (Example on ZappySys Salesforce Connection UI -&gt; Advanced Tab -&gt; Set scope as "<strong>api offline_access</strong>" rather than "<strong>full offline_access</strong>"</li>
 	<li>Click "Save".</li>
</ol>
<h3>Get Client Id and Client Secret for Salesforce Connected App</h3>
Once the App is created, we need to find out the App Id / Secret so we can use it for API calls.
<ol>
 	<li>Go to App Manager</li>
 	<li>Find out the recently created App and click View (click on the small arrow to the right)
<a href="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-view-edit-oauth-app-settings.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-9477" src="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-view-edit-oauth-app-settings.png" alt="" width="1029" height="413" srcset="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-view-edit-oauth-app-settings.png 1029w, https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-view-edit-oauth-app-settings-300x120.png 300w, https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-view-edit-oauth-app-settings-768x308.png 768w, https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-view-edit-oauth-app-settings-1024x411.png 1024w" sizes="(max-width: 1029px) 100vw, 1029px" /></a></li>
 	<li>Once App page is loaded you can Copy <strong>Consumer Key</strong> and <strong>Consumer Secret</strong> (click on reveal to see). Also copy anyone Call back URL (We will need this for OAuth Connection &gt; Advanced Tab &gt; Call Back URL or Redirect URL property depending on which ZappySys Product / Driver you are using)
<a href="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-oauth-app-clientid-secret-callbackurl.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-9478" src="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-oauth-app-clientid-secret-callbackurl.png" alt="" width="974" height="554" srcset="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-oauth-app-clientid-secret-callbackurl.png 974w, https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-oauth-app-clientid-secret-callbackurl-300x171.png 300w, https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-oauth-app-clientid-secret-callbackurl-768x437.png 768w" sizes="(max-width: 974px) 100vw, 974px" /></a></li>
 	<li>That's it, you can now use these 3 pieces to ZappySys <strong>OAuth connection UI</strong> or on <strong>Salesforce Connection UI</strong> (new version with OAuth support). The above screenshot shows where to enter these 3 pieces in the New Salesforce Connection. For the OAuth Connection, the redirect URL goes to the Advanced Tab &gt; Callback URL textbox.</li>
</ol>
<h3>Get Client Id and Secret for Salesforce External Client App</h3>
If you created a new App by clicking on the <strong>New External Client App</strong> button, then your App may not be visible in the App Manager Screen. In that case, find it below way.

[caption id="attachment_11637" align="alignnone" width="1222"]<a href="https://zappysys.com/blog/wp-content/uploads/2021/12/obtain-salesforce-oauth-clientid-secret.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-11637" src="https://zappysys.com/blog/wp-content/uploads/2021/12/obtain-salesforce-oauth-clientid-secret.jpg" alt="" width="1222" height="733" srcset="https://zappysys.com/blog/wp-content/uploads/2021/12/obtain-salesforce-oauth-clientid-secret.jpg 1222w, https://zappysys.com/blog/wp-content/uploads/2021/12/obtain-salesforce-oauth-clientid-secret-300x180.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2021/12/obtain-salesforce-oauth-clientid-secret-1024x614.jpg 1024w, https://zappysys.com/blog/wp-content/uploads/2021/12/obtain-salesforce-oauth-clientid-secret-768x461.jpg 768w" sizes="(max-width: 1222px) 100vw, 1222px" /></a> Get Client Id, Client Secret - For New External Client App[/caption]
<h3>Enable Client Credentials Grant (Non-Interactive Run-As)</h3>
If you like to enable Non-Interactive mode, just like UserId / Password Authentication, but without actually passing a real UserId or Password on the Connection UI, then you can enable Client Credentials Flow as below.

<strong>NOTE:</strong> Only the New version of ZappySys Salesforce Connection supports Client Credentials Grant. <span style="text-decoration: underline;"><strong>Version released after Nov 1, 2025 supports this grant type</strong></span>.

[caption id="attachment_11639" align="alignnone" width="419"]<a href="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-client-credentials-grant-runas.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-11639" src="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-client-credentials-grant-runas.jpg" alt="" width="419" height="480" srcset="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-client-credentials-grant-runas.jpg 419w, https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-client-credentials-grant-runas-262x300.jpg 262w" sizes="(max-width: 419px) 100vw, 419px" /></a> Enable Salesforce Client Credentials Grant (Run As)[/caption]
<h3>(OPTIONAL) Configure Salesforce OAuth refresh token validity</h3>
By default, Salesforce Refresh Token doesn't expire once you generate. If you want to change the default behavior, follow these steps.
<ol>
 	<li>Go to "<strong>Manage Connected Apps</strong>" menu item and press on your App name:<img loading="lazy" decoding="async" class="wp-image-4298 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-oauth-app-policy-management-2.png" alt="Finding Salesforce App to configure its policies" width="660" height="410" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-oauth-app-policy-management-2.png 660w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-oauth-app-policy-management-2-300x186.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-oauth-app-policy-management-2-436x272.png 436w" sizes="(max-width: 660px) 100vw, 660px" /></li>
 	<li>Click "Edit Policies" to configure refresh token validity:
<img loading="lazy" decoding="async" class="wp-image-4271 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/edit-salesforce-connected-app-policies.png" alt="Editing Salesforce App OAuth refresh token issuing policy" width="680" height="391" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/edit-salesforce-connected-app-policies.png 680w, https://zappysys.com/blog/wp-content/uploads/2018/06/edit-salesforce-connected-app-policies-300x173.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></li>
 	<li>Set "<strong>All users may self-authorize</strong>" and "<strong>Refresh token is valid until revoked</strong>" options:<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-app-odbc-oauth-refresh-token-validity-1.png"><img loading="lazy" decoding="async" class="wp-image-4273 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-app-odbc-oauth-refresh-token-validity-1.png" alt="Making Salesforce App OAuth refresh token to never expire" width="870" height="498" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-app-odbc-oauth-refresh-token-validity-1.png 870w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-app-odbc-oauth-refresh-token-validity-1-300x172.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-app-odbc-oauth-refresh-token-validity-1-768x440.png 768w" sizes="(max-width: 870px) 100vw, 870px" /></a></li>
 	<li>Click "Save".</li>
</ol>
<h3></h3></div>
<h2>Using Salesforce Connection with OAuth App in SSIS / ODBC</h2>
<p>Once you have Client ID / Secret, you can use it in the Salesforce Connection in SSIS Connector / ODBC Driver for Salesforce like below (Only the new version will have OAuth option)</p>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-connection-using-oauth-app-clientid-secret.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-9513" src="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-connection-using-oauth-app-clientid-secret.png" alt="" width="604" height="383" srcset="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-connection-using-oauth-app-clientid-secret.png 604w, https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-connection-using-oauth-app-clientid-secret-300x190.png 300w" sizes="(max-width: 604px) 100vw, 604px" /></a></p>
<h2>Troubleshooting Known Issues</h2>
<p>Let&#8217;s look at some common issues with Salesforce Connection and how to fix them.</p>
<h3>OAuth Error: Missing Required Code Challenge</h3>
<p>When you click Generate Token button, you may get an error like the one below.</p>
<div id="attachment_11066" style="width: 767px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-oauth-pkce-verfier-error-missing-required-code-challenge.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11066" class="size-full wp-image-11066" src="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-oauth-pkce-verfier-error-missing-required-code-challenge.png" alt="Salesforce OAuth Generate Token Error - Missing Required Code Challenge" width="757" height="571" srcset="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-oauth-pkce-verfier-error-missing-required-code-challenge.png 757w, https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-oauth-pkce-verfier-error-missing-required-code-challenge-300x226.png 300w" sizes="(max-width: 757px) 100vw, 757px" /></a><p id="caption-attachment-11066" class="wp-caption-text">Salesforce OAuth Generate Token Error &#8211; Missing Required Code Challenge</p></div>
<p><strong>Solution</strong></p>
<p>Here is how to fix it.</p>
<p>For Salesforce Connection UI: Go to Advanced Tab =&gt; Check Enable PKCE Code Verifier option<br />
&#8211;OR&#8211;<br />
For OAuth Connection UI: Go to OAuth2 Grant Options Tab =&gt; Check Enable Code Verifier Option</p>
<div id="attachment_11067" style="width: 1384px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2021/12/oauth-connection-enable-pkce-code-verifier-option.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11067" class="size-full wp-image-11067" src="https://zappysys.com/blog/wp-content/uploads/2021/12/oauth-connection-enable-pkce-code-verifier-option.png" alt="Enable PKCE code verifier option - OAuth Connection for Salesforce" width="1374" height="637" srcset="https://zappysys.com/blog/wp-content/uploads/2021/12/oauth-connection-enable-pkce-code-verifier-option.png 1374w, https://zappysys.com/blog/wp-content/uploads/2021/12/oauth-connection-enable-pkce-code-verifier-option-300x139.png 300w, https://zappysys.com/blog/wp-content/uploads/2021/12/oauth-connection-enable-pkce-code-verifier-option-1024x475.png 1024w, https://zappysys.com/blog/wp-content/uploads/2021/12/oauth-connection-enable-pkce-code-verifier-option-768x356.png 768w" sizes="(max-width: 1374px) 100vw, 1374px" /></a><p id="caption-attachment-11067" class="wp-caption-text">Enable PKCE code verifier option &#8211; OAuth Connection for Salesforce.</p></div>
<p>The post <a href="https://zappysys.com/blog/register-salesforce-app-obtain-client-id-secret-oauth-api-call/">How to register Salesforce App and obtain Client ID / Secret (for API Call / OAuth)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Download Salesforce Attachment in SSIS</title>
		<link>https://zappysys.com/blog/download-salesforce-attachment-in-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys Team]]></dc:creator>
		<pubDate>Sat, 26 Dec 2020 20:25:11 +0000</pubDate>
				<category><![CDATA[REST API]]></category>
		<category><![CDATA[SSIS Salesforce Source]]></category>
		<category><![CDATA[attachment]]></category>
		<category><![CDATA[salesforce]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=9190</guid>

					<description><![CDATA[<p>Introduction Download Salesforce Attachment in SSIS can be difficult the first time. In this new article, we will show how to download an Attachment from the Salesforce Source into a file using SSIS. Working with images is always tricky the first time. However, with the right article, this process is really simple. This article will show you how [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/download-salesforce-attachment-in-ssis/">Download Salesforce Attachment in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>Download Salesforce Attachment in SSIS can be difficult the first time. In this new article, we will show how to download an Attachment from the <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-source-connector/#:~:text=SSIS%20Salesforce%20Source%20Connector%20(CRM,.com%20Object%20Query%20Language).">Salesforce Source</a> into a file using SSIS. Working with images is always tricky the first time. However, with the right article, this process is really simple. This article will show you how simple it is to do it.</p>
<p>Salesforce is an extremely powerful CRM based in the cloud. This company was created in California, San Francisco and it is a very common request to get the information from the cloud into a file automatically. These can be achieved with our ZappySys SSIS PowerPack plus some SSIS tasks.</p>
<h2>Requirements</h2>
<p>In order to do it, we will need the following components:</p>
<ol>
<li><a href="https://docs.microsoft.com/en-us/sql/ssdt/previous-releases-of-sql-server-data-tools-ssdt-and-ssdt-bi?view=sql-server-ver15">SSDT for SSIS</a> installed</li>
<li><a href="https://zappysys.com/products/ssis-powerpack/download/">ZappySys SSIS Powerpack</a> installed</li>
<li>A connection to Salesforce. In order to create a connection to Salesforce, check <a href="https://zappysys.com/products/ssis-powerpack/download/">this video </a>or <a href="https://zappysys.com/blog/export-data-from-salesforce-to-sql-server-using-ssis/">check our article related</a>.</li>
<li>Finally, we will need a file in Salesforce to download.</li>
</ol>
<h2>Getting Started</h2>
<h3>Creating the connection</h3>
<ol>
<li>First of all, in SSDT, create a new SSIS project</li>
<li>In order to create a connection in SSDT, go to the connection manager, and select a new connection.
<div id="attachment_9202" style="width: 560px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-create-gmail-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9202" class="size-full wp-image-9202" src="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-create-gmail-connection.png" alt="Salesforce Connection" width="550" height="315" srcset="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-create-gmail-connection.png 550w, https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-create-gmail-connection-300x172.png 300w" sizes="(max-width: 550px) 100vw, 550px" /></a><p id="caption-attachment-9202" class="wp-caption-text">ssis-create-salesforce-connection</p></div></li>
<li>Also, Select the ZS Salesforce connection. This new connection is created by the <a href="https://zappysys.com/products/ssis-powerpack/download/">ZS SSIS PowerPack</a> plugin mentioned in the requirements. With this connection, we can easily connect to Salesforce and get the Information.
<div id="attachment_9203" style="width: 520px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-salesforce-connection-create.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9203" class="size-full wp-image-9203" src="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-salesforce-connection-create.png" alt="Select SSIS Salesforce" width="510" height="488" srcset="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-salesforce-connection-create.png 510w, https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-salesforce-connection-create-300x287.png 300w" sizes="(max-width: 510px) 100vw, 510px" /></a><p id="caption-attachment-9203" class="wp-caption-text">Select SSIS Salesforce connection</p></div></li>
<li>Finally, write your email, password, and token. For more information about getting the token, please <a href="https://zappysys.com/blog/export-data-from-salesforce-to-sql-server-using-ssis/">check our article related</a>.
<div style="width: 682px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full" src="https://i0.wp.com/zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-using-ssis-salesforce-connection-manager.jpg?w=672&amp;ssl=1" alt="SSIS salesforce credentials" width="672" height="531" /><p class="wp-caption-text">Salesforce credentials in SSIS</p></div></li>
</ol>
<h3>Creating the package</h3>
<ol>
<li>First of All, Drag and drop the Data Flow Task from SSIS Toolbox and double-click it to edit.
<div id="attachment_7934" style="width: 470px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7934" class="size-full wp-image-7934" src="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png" alt="Drag and Drop SSIS Data Flow Task from SSIS Toolbox" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /></a><p id="caption-attachment-7934" class="wp-caption-text">Drag and Drop : Data Flow Task from SSIS Toolbox</p></div></li>
<li>Secondly, in the Data Flow, we will use the Salesforce Source to connect to Salesforce and get the attachments.
<div id="attachment_1818" style="width: 255px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-salesforce-source-ssis-component.jpg" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1818" class="wp-image-1818 size-full" title="Drag and Drop Salesforce Source" src="https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-salesforce-source-ssis-component.jpg" alt="Drag and Drop Salesforce Source" width="245" height="192" /></a><p id="caption-attachment-1818" class="wp-caption-text">Drag and Drop: Salesforce Source from SSIS Toolbox</p></div></li>
<li>For this purpose, we will use the attachment table from Salesforce.<a href="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-salesforece-picture.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-9192" src="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-salesforece-picture.png" alt="" width="886" height="603" srcset="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-salesforece-picture.png 886w, https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-salesforece-picture-300x204.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-salesforece-picture-768x523.png 768w" sizes="(max-width: 886px) 100vw, 886px" /></a></li>
<li>In addition, we will get the columns from the table. The image is in the body, however, we have additional columns like the id, name, ContenType, BodyLenght, createDate, and more:
<div id="attachment_9193" style="width: 896px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-salesforce-columns.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9193" class="size-full wp-image-9193" src="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-salesforce-columns.png" alt="Salesforece columns in SSIS" width="886" height="603" srcset="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-salesforce-columns.png 886w, https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-salesforce-columns-300x204.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-salesforce-columns-768x523.png 768w" sizes="(max-width: 886px) 100vw, 886px" /></a><p id="caption-attachment-9193" class="wp-caption-text">SSIS Salesforce Columns</p></div></li>
<li>Next, we will need to drag and drop SSIS Derived Column from the SSIS Toolbox below the Salesforce Source and connect it.
<div id="attachment_10219" style="width: 503px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-drag-and-drop-derived-column.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10219" class="size-full wp-image-10219" src="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-drag-and-drop-derived-column.png" alt="Drag and drop the Derived Column" width="493" height="345" srcset="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-drag-and-drop-derived-column.png 493w, https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-drag-and-drop-derived-column-300x210.png 300w" sizes="(max-width: 493px) 100vw, 493px" /></a><p id="caption-attachment-10219" class="wp-caption-text">Drag and drop the Derived Column</p></div></li>
<li>Double-click on the derived column, to specify the path to store the image in a local folder.
<div id="attachment_9194" style="width: 934px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-derived-column-path-download-attachment-salesforece.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9194" class="size-full wp-image-9194" src="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-derived-column-path-download-attachment-salesforece.png" alt="saleforece download image" width="924" height="467" srcset="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-derived-column-path-download-attachment-salesforece.png 924w, https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-derived-column-path-download-attachment-salesforece-300x152.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-derived-column-path-download-attachment-salesforece-768x388.png 768w" sizes="(max-width: 924px) 100vw, 924px" /></a><p id="caption-attachment-9194" class="wp-caption-text">SSIS-derived column download image salesforce</p></div></li>
<li>Now let&#8217;s, drag and drop SSIS Export Column from the SSIS Toolbox &gt;&gt; Other Transforms.
<div id="attachment_10220" style="width: 443px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-drag-and-drop-export-column.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10220" class="size-full wp-image-10220" src="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-drag-and-drop-export-column.png" alt="Drag and drop Export Column" width="433" height="291" srcset="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-drag-and-drop-export-column.png 433w, https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-drag-and-drop-export-column-300x202.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-drag-and-drop-export-column-272x182.png 272w" sizes="(max-width: 433px) 100vw, 433px" /></a><p id="caption-attachment-10220" class="wp-caption-text">Drag and drop Export Column</p></div></li>
<li>Double-click on the Export column to download an image of the body. In the Extract Column map the Body column of File data and the Path Column to where you want to save that file.
<div id="attachment_9191" style="width: 909px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/12/download-salesforce-attachment-body.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9191" class="wp-image-9191 size-full" src="https://zappysys.com/blog/wp-content/uploads/2020/12/download-salesforce-attachment-body.png" alt="Download attachment salesforce" width="899" height="261" srcset="https://zappysys.com/blog/wp-content/uploads/2020/12/download-salesforce-attachment-body.png 899w, https://zappysys.com/blog/wp-content/uploads/2020/12/download-salesforce-attachment-body-300x87.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/12/download-salesforce-attachment-body-768x223.png 768w" sizes="(max-width: 899px) 100vw, 899px" /></a><p id="caption-attachment-9191" class="wp-caption-text">SSIS export column salesforce image</p></div></li>
<li>Finally, we will use the trash destination to get the image and finish the flow.
<div id="attachment_9195" style="width: 267px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-trash-destination.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9195" class="size-full wp-image-9195" src="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-trash-destination.png" alt="Destination ssis salesforce" width="257" height="84" /></a><p id="caption-attachment-9195" class="wp-caption-text">SSIS Trash destination</p></div></li>
<li>Now, we are ready. Your package should be something like this:
<div id="attachment_9196" style="width: 340px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-full-salesforce-download-package.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9196" class="wp-image-9196 size-full" src="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-full-salesforce-download-package.png" alt="Download Salesforce Attachment in SSIS " width="330" height="322" srcset="https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-full-salesforce-download-package.png 330w, https://zappysys.com/blog/wp-content/uploads/2020/12/ssis-full-salesforce-download-package-300x293.png 300w" sizes="(max-width: 330px) 100vw, 330px" /></a><p id="caption-attachment-9196" class="wp-caption-text">ssis-full-download-package</p></div></li>
<li>Run the package to test it.</li>
<li>If everything is fine, we will be able to see the file. As you can see Downloading Salesforce Attachment in SSIS is a straightforward process.</li>
</ol>
<p>&nbsp;</p>
<h2>Conclusion</h2>
<p>In conclusion, we learned in this article how to Download Salesforce Attachment in SSIS. Basically, you need to use the ZappySys salesforce source, then use the derived column to specify the path and the Export column to get the image. Finally, the ZS Trash destination will be used  If you liked this article, do not hesitate to continue testing and using <a href="https://zappysys.com/">ZappySys PowerPack for SSIS.</a></p>
<p>The post <a href="https://zappysys.com/blog/download-salesforce-attachment-in-ssis/">Download Salesforce Attachment in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to read Salesforce Metadata in SSIS using REST API (JSON Source)</title>
		<link>https://zappysys.com/blog/read-salesforce-metadata-ssis-using-rest-api-json-source/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Mon, 18 May 2020 16:13:07 +0000</pubDate>
				<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS Salesforce Connection]]></category>
		<category><![CDATA[metadata]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[salesforce]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=8909</guid>

					<description><![CDATA[<p>Introduction 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. Step-By-Step In this section you will learn how to use ZappySys JSON Source Adapter to extract data from Salesforce REST API (JSON Format). You [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-salesforce-metadata-ssis-using-rest-api-json-source/">How to read Salesforce Metadata in SSIS using REST API (JSON Source)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In our previous posts we saw how to <a href="https://zappysys.com/blog/export-data-from-salesforce-to-sql-server-using-ssis/" target="_blank" rel="noopener">read</a> and <a href="https://zappysys.com/blog/loading-data-salesforce-using-ssis-bulk-insert-update-delete/" target="_blank" rel="noopener">write</a> Salesforce Data using SSIS. In this post we will see how to read Salesforce Metadata in SSIS using <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">JSON Source</a>.</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2>Step-By-Step</h2>
<p>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 <a href="https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_basic_info.htm" target="_blank" rel="noopener">sobjects</a> to get all table information) .</p>
<p>So lets get started.</p>
<ol>
<li>In case you missed the previous section, You need to <b>Download and Install</b> SSIS <a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">ZappySys PowerPack.</a></li>
<li>Once you finished first step, Open Visual Studio and Create New SSIS Package Project.</li>
<li>Now, Drag and Drop SSIS <b>Data Flow Task</b> from SSIS Toolbox.<br />
<img decoding="async" class="figureimage" title="SSIS Data Flow Task - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/drag-and-drop-data-flow-task.png" alt="SSIS Data Flow Task - Drag and Drop" /></li>
<li>Double click on the Data Flow task to see Data Flow designer surface.</li>
<li>From the SSIS toolbox drag and drop JSON Source on the Data Flow designer surface.<br />
<img decoding="async" class="figureimage" title="SSIS JSON Source - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/json-source/ssis-json-source-adapter-drag.png" alt="SSIS JSON Source - Drag and Drop" /></li>
<li>Now double click JSON Source enter any valid REST API URL like below. Make sure you used correct instance name. Using wrong instance name might slow down connection or fail your request. If you are not sure then just login to salesforce portal using credentials you like to use and observe browser URL.. It will have instance number.<br />
<pre class="crayon-plain-tag">https://na34.salesforce.com/services/data/v20.0/sobjects/Account/describe/</pre>
</li>
<li>Check Use Connection and select New <strong>ZS-Salesforce</strong> Connection from the list.
<div id="attachment_8918" style="width: 602px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/create-ssis-rest-api-connection-connect-http-oauth-salesforce.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8918" class="size-full wp-image-8918" src="https://zappysys.com/blog/wp-content/uploads/2018/07/create-ssis-rest-api-connection-connect-http-oauth-salesforce.png" alt="Create new REST API Connection in SSIS (For JSON, XML or CSV Source)" width="592" height="215" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/create-ssis-rest-api-connection-connect-http-oauth-salesforce.png 592w, https://zappysys.com/blog/wp-content/uploads/2018/07/create-ssis-rest-api-connection-connect-http-oauth-salesforce-300x109.png 300w" sizes="(max-width: 592px) 100vw, 592px" /></a><p id="caption-attachment-8918" class="wp-caption-text">Create new REST API Connection in SSIS (For JSON, XML or CSV Source)</p></div></li>
<li>Configure your salesforce connection<br />
<img decoding="async" class="figureimage" title="SSIS Salesforce Connection Manager UI " src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/salesforce-connection/ssis-salesforce-connection-manager-ui.png" alt="SSIS Salesforce Connection Manager UI " /></li>
<li>Select or type filter. For example in this case you will type <pre class="crayon-plain-tag">$.sobjects[*]</pre></li>
<li>Click OK to Save UI and attach your source to some target like OLEDB Destination and run your data flow to test.</li>
<li>Here is full UI after all configurations.
<div id="attachment_10310" style="width: 909px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-salesforce-call-rest-api-get-metadata-eg-table-field-list.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10310" class="wp-image-10310 size-full" src="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-salesforce-call-rest-api-get-metadata-eg-table-field-list.png" alt="ssis-salesforce-call-rest-api-get-metadata-eg-table-field-list" width="899" height="792" srcset="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-salesforce-call-rest-api-get-metadata-eg-table-field-list.png 899w, https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-salesforce-call-rest-api-get-metadata-eg-table-field-list-300x264.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-salesforce-call-rest-api-get-metadata-eg-table-field-list-768x677.png 768w" sizes="(max-width: 899px) 100vw, 899px" /></a><p id="caption-attachment-10310" class="wp-caption-text">Read Salesforce Metadata in SSIS (Get Table List Example &#8211; SOObject REST API Call)</p></div></li>
</ol>
<h2>How to read Salesforce Table Fields Metadata</h2>
<p>If you have need to read fields and its information for tables then use below steps</p>
<ol>
<li>Use almost identical steps as previous section. Except two things. Our URL and Filter would be different.</li>
<li>Configure your API URL as below<br />
<pre class="crayon-plain-tag">https://YOUR-INSTANCE.salesforce.com/services/data/v20.0/sobjects/YOUR-TABLE/describe/</pre>
<strong>Example:</strong><br />
<pre class="crayon-plain-tag">https://demo.salesforce.com/services/data/v20.0/sobjects/Account/describe/</pre>
</li>
<li>Configure Filter as a <pre class="crayon-plain-tag">$.fields[*]</pre></li>
</ol>
<div id="attachment_10311" style="width: 902px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-salesforce-get-table-fields-metadata-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10311" class="wp-image-10311 size-full" src="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-salesforce-get-table-fields-metadata-1.png" alt="ssis-salesforce-get-table-fields-metadata-1" width="892" height="757" srcset="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-salesforce-get-table-fields-metadata-1.png 892w, https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-salesforce-get-table-fields-metadata-1-300x255.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-salesforce-get-table-fields-metadata-1-768x652.png 768w" sizes="(max-width: 892px) 100vw, 892px" /></a><p id="caption-attachment-10311" class="wp-caption-text">Get Salesforce Table Fields Metadata using REST API call in SSIS</p></div>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/read-salesforce-metadata-ssis-using-rest-api-json-source/">How to read Salesforce Metadata in SSIS using REST API (JSON Source)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>ODBC PowerPack v1.1.4 Released</title>
		<link>https://zappysys.com/blog/odbc-powerpack-v1-1-4-released/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 11 Sep 2019 19:47:17 +0000</pubDate>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[openquery]]></category>
		<category><![CDATA[salesforce]]></category>
		<category><![CDATA[upsert]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=7971</guid>

					<description><![CDATA[<p>What&#8217;s New In this version we focused on many bug fixes. Among them most important bug was limitation of only 2000 characters for SQL Query using OPENQUERY statement. Now you can use up to 8000 characters for OPENQUERY and if that&#8217;s not enough use EXEC AT statement to send query to Data Gateway. We also [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/odbc-powerpack-v1-1-4-released/">ODBC PowerPack v1.1.4 Released</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>What&#8217;s New</h2>
<p>In this version we focused on many bug fixes. Among them most important bug was limitation of only 2000 characters for SQL Query using OPENQUERY statement. Now you can use up to 8000 characters for OPENQUERY and if that&#8217;s not enough use EXEC AT statement to send query to Data Gateway. We also made many improvements with our Salesforce Driver so now you can use it along with Data Gateway or any other Reporting / ETL tools.</p>
<h2 class="vertitle">Version 1.1.4.10904 [Sep 11, 2019]</h2>
<h3 class="versubtitle">New Features/Improvements</h3>
<ul>
<li><span class="verAdded">NEW: </span>All Drivers &#8211; New DSN dialogbox should suggest unique DSN name if already exists (Prevent accidental overwrite)</li>
<li><span class="verAdded">NEW: </span>All Drivers &#8211; Add support for named parameters for stored procs (e.g. exec webrequest @uri=&#8217;https://abc.com&#8217; )</li>
<li><span class="verAdded">NEW: </span>Data Gateway &#8211; Give Export / Import Settings option</li>
<li><span class="verAdded">NEW: </span>Data Gateway &#8211; Provide list of database to caller App</li>
<li><span class="verAdded">NEW: </span>General &#8211; Use default log file name if only folder name is supplied</li>
<li><span class="verAdded">NEW: </span>Salesforce Driver &#8211; Add Placeholder Engine Support</li>
</ul>
<h3 class="versubtitle">Bug fixes</h3>
<ul>
<li><span class="verFixed">FIX: </span>All API Drivers &#8211; Query builders shows Password and Default Attributes on first time launch</li>
<li><span class="verFixed">FIX: </span>All API Drivers &#8211; RetryInfo not included in Connectionstring or generated SQL</li>
<li><span class="verFixed">FIX: </span>All API Drivers &#8211; URL JOIN may cause error for decimal values &#8211; Query execution error: Input string was not in a correct format.</li>
<li><span class="verFixed">FIX: </span>All API Drivers &#8211; URL on general tab is wiped out when you use save HTTP Connection</li>
<li><span class="verFixed">FIX: </span>All API Drivers &#8211; Field names are wrong StatucFieldxxxxxxx and StatucCheckxxxxxx rather than StatusCheckxxxxxx and StatusFieldxxxxxxx</li>
<li><span class="verFixed">FIX: </span>CSV Driver &#8211; JOIN query fails in CSV driver with invalid format detected</li>
<li><span class="verFixed">FIX: </span>Data Gateway &#8211; MS SQL Server &#8211; Support more than 2000 characters for SQL in OPENROWSET and EXEC &#8211; In old version you may get error &#8211; Data is invalid if text is longer than 2000 characters</li>
<li><span class="verFixed">FIX: </span>Data Gateway &#8211; Query with Caching Option hangs</li>
<li><span class="verFixed">FIX: </span>Data Gateway &#8211; Use of META in WITH clause prevents error in some cases</li>
<li><span class="verFixed">FIX: </span>Data Gateway &#8211; You may get &#8220;The data is invalid&#8221; error when the query is too long</li>
<li><span class="verFixed">FIX: </span>Data Gateway &#8211; You may get Data is invalid error for OAuth Authorization failure</li>
<li><span class="verFixed">FIX: </span>Salesforce Driver &#8211; When you execute INSERT via Linked Server Query it Inserts row but fails with error at the end</li>
<li><span class="verFixed">FIX: </span>Salesforce Driver &#8211; Load ConnectionString action throws Object reference not set to an instance of an object.</li>
<li><span class="verFixed">FIX: </span>Salesforce Driver &#8211; Click on Generate SQL throws Object reference not set to an instance of an object</li>
<li><span class="verFixed">FIX: </span>Salesforce Driver &#8211; Data is not returned in Excel when you use [From Microsoft Query] option</li>
<li><span class="verFixed">FIX: </span>Salesforce Driver &#8211; DELETE statement not working</li>
<li><span class="verFixed">FIX: </span>Salesforce Driver &#8211; Escape sequence not supported (e.g. WHERE name =&#8217;Sam\&#8217;s&#8217; )</li>
<li><span class="verFixed">FIX: </span>Salesforce Driver &#8211; OPENQUERY / EXEC AT doesn&#8217;t work with DELETE / UPDATE / INSERT</li>
<li><span class="verFixed">FIX: </span>Salesforce Driver &#8211; SSIS Failed to Generate Metadata due to character encoding issue</li>
<li><span class="verFixed">FIX: </span>Salesforce Driver &#8211; Using * in SELECT with WHERE is not working</li>
</ul>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/odbc-powerpack-v1-1-4-released/">ODBC PowerPack v1.1.4 Released</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Load data in Salesforce using SSIS  – Insert, Upsert, Delete, Update</title>
		<link>https://zappysys.com/blog/loading-data-salesforce-using-ssis-bulk-insert-update-delete/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 07 Dec 2018 18:09:59 +0000</pubDate>
				<category><![CDATA[SSIS Salesforce Destination]]></category>
		<category><![CDATA[crm]]></category>
		<category><![CDATA[salesforce]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[upsert]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=5539</guid>

					<description><![CDATA[<p>Introduction In this article we&#8217;re going to focus on load data in Salesforce using SSIS (Bulk Insert, Update, Delete and Upsert). If you like to know how to read from Salesforce then refer to previous post here. For Demo purpose we will use AdventuresWorks sample database as our source but you can use your own [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/loading-data-salesforce-using-ssis-bulk-insert-update-delete/">Load data in Salesforce using SSIS  – Insert, Upsert, Delete, Update</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180.png"><img loading="lazy" decoding="async" class="wp-image-1764 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180.png" alt="" width="158" height="158" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180.png 180w, https://zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180-150x150.png 150w" sizes="(max-width: 158px) 100vw, 158px" /></a>In this article we&#8217;re going to focus on load data in Salesforce using SSIS (Bulk Insert, Update, Delete and Upsert). If you like to know how to read from Salesforce then refer to <a href="https://zappysys.com/blog/export-data-from-salesforce-to-sql-server-using-ssis/">previous post here</a>. For Demo purpose we will use AdventuresWorks sample database as our source but you can use your own Database for testing.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2>Salesforce developer account</h2>
<p>To develop ETLs in Salesforce using SSIS you&#8217;ll need a Salesforce developer account. If you don&#8217;t have one, don&#8217;t worry, you can create a limited version FREE developer account. Click here to Sign up for <a href="https://developer.salesforce.com/signup" target="_blank" rel="noopener">FREE developer</a> account.</p>
<h2>Video Tutorial – Salesforce Insert, Upsert, Delete, Update</h2>
<a href="https://zappysys.com/blog/loading-data-salesforce-using-ssis-bulk-insert-update-delete/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FulQLMIaSdJQ%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<p>&nbsp;</p>
<h2>Getting Started</h2>
<p>In this section, we will see how to perform bulk insert, update delete and upsert operations using <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-destination-connector/" target="_blank" rel="noopener">ZS Salesforce Destination</a></p>
<h3>Configure Salesforce Connection</h3>
<p>First, we&#8217;ll need setup a connection to read or write Salesforce data is to make sure we have a working connection in SSIS.</p>
<ol>
<li>Create new or open existing SSIS Project in Visual Studio.</li>
<li>Open SSIS Package and Go to SSIS designer.</li>
<li>Right click in the connection manager panel and click <strong>New connection</strong>
<div id="attachment_3560" style="width: 756px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3560" class="wp-image-3560 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/05/create-a-new-connection.jpg" alt="SSIS create a new connection CRM Dynamics" width="746" height="403" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/create-a-new-connection.jpg 746w, https://zappysys.com/blog/wp-content/uploads/2018/05/create-a-new-connection-300x162.jpg 300w" sizes="(max-width: 746px) 100vw, 746px" /><p id="caption-attachment-3560" class="wp-caption-text">Create a new SSIS Salesforce Connection</p></div></li>
<li>In the connection type selection, Select the <strong>ZS-SALESFORCE </strong>Connection.</li>
<li>We&#8217;ll use this information: Username, Password, Security Token (<em>click the link learn how to obtain</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360000220714-How-to-obtain-alesforce-Security-Token" target="_blank" rel="noopener">Salesforce Security Token</a> )</li>
<li>Click OK to add the connection.
<div id="attachment_5979" style="width: 682px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5979" class="size-full wp-image-5979" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-salesforce-connection.png" alt="Salesforce using SSIS, Salesforce connection" width="672" height="531" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-salesforce-connection.png 672w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-salesforce-connection-300x237.png 300w" sizes="(max-width: 672px) 100vw, 672px" /><p id="caption-attachment-5979" class="wp-caption-text">Salesforce using SSIS, Salesforce connection</p></div></li>
<li>Save all changes</li>
</ol>
<h2>Bulk Insert &#8211; Import data into Salesforce using SSIS</h2>
<p>Let&#8217;s start with the a bulk insert in Salesforce using SSIS. On this section, we&#8217;re going to generate retrieve data from and OLEDB Source and proceed to Insert the records into Salesforce using <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-destination-connector/" target="_blank" rel="noopener">ZS Salesforce Destination</a>.</p>
<h3>Configure SQL Server Source (OLEDB)</h3>
<ol>
<li>Open SSIS Package and drag Data Flow task from Control Flow SSIS Toolbox
<div id="attachment_8028" style="width: 470px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8028" class="size-full wp-image-8028" src="https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task.png" alt="" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /><p id="caption-attachment-8028" class="wp-caption-text">Dragging and dropping Data Flow Task into Control Flow</p></div></li>
<li>Go to data flow designer. Drag and drop an OLE DB Source</li>
<li>Open the OLE DB Source and configure as follow:
<div id="attachment_5964" style="width: 512px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5964" class="size-full wp-image-5964" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-source-oledb-1.png" alt="salesforce-using-ssis-insert-source-oledb" width="502" height="399" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-source-oledb-1.png 502w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-source-oledb-1-300x238.png 300w" sizes="(max-width: 502px) 100vw, 502px" /><p id="caption-attachment-5964" class="wp-caption-text">Configure SQL Server Source</p></div></li>
</ol>
<h3>Configure SSIS Salesforce Destination for Bulk Insert</h3>
<p>Once SQL Server source is configure. Now let&#8217;s configure Salesforce Destination for Bulk Insert like below.</p>
<ol>
<li>Drag and drop <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-destination-connector/" target="_blank" rel="noopener">ZS Salesforce Destination</a></li>
<li>Open the destination component</li>
<li>Connection Manager
<div id="attachment_5972" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5972" class="size-full wp-image-5972" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager.png" alt="" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-5972" class="wp-caption-text">Salesforce using SSIS, upsert destination connection manager</p></div></li>
<li>Component Properties
<div id="attachment_5966" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5966" class="size-full wp-image-5966" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-properties-1.png" alt="salesforce-using-ssis-insert-properties" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-properties-1.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-properties-1-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-5966" class="wp-caption-text">salesforce-using-ssis-insert-properties</p></div></li>
<li>Column Mappings
<div id="attachment_5967" style="width: 762px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5967" class="size-full wp-image-5967" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-mapping.png" alt="salesforce-using-ssis-insert-mapping" width="752" height="379" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-mapping.png 752w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-mapping-300x151.png 300w" sizes="(max-width: 752px) 100vw, 752px" /><p id="caption-attachment-5967" class="wp-caption-text">salesforce-using-ssis-insert-mapping</p></div></li>
<li>Click OK</li>
<li>Drag and drop two <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=trash-destination.htm" target="_blank" rel="noopener">Trash Destination</a> components</li>
<li>Connect ZS Salesforce Destination for: New records Output and Error Output</li>
<li>Right click on the joining arrows and enable data viewers on all previous connections</li>
<li>Save all changes</li>
<li>Right click in the data flow designer, click Execute Task
<div id="attachment_5968" style="width: 864px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5968" class="size-full wp-image-5968" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-results.png" alt="salesforce-using-ssis-insert-results" width="854" height="280" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-results.png 854w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-results-300x98.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-results-768x252.png 768w" sizes="(max-width: 854px) 100vw, 854px" /><p id="caption-attachment-5968" class="wp-caption-text">salesforce-using-ssis-insert-results</p></div></li>
</ol>
<h2>Bulk Update &#8211; Modify data in Salesforce using SSIS</h2>
<p>In this section we&#8217;re going to perform a bulk update on Salesforce using SSIS. We&#8217;re going to list some information from our source, list all our Salesforce Account data, merge it and only update the data we match. In below example what we will do is Find out matching records in Salesforce and our Source System based on some External Key field (e.g. AccountNumber in our case). And then obtain Salesforce Record <strong>Id</strong> for matching AccountNumber and use it to Update target record.</p>
<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff8b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">If you are storing Salesforce Id fields part of your Source System then you don&#8217;t need to use Merge Transform to lookup by External ID field (e.g. AccountNumber in our case). Simply Attach Source with Salesforce Destination and map Id field along with other fields you like to Update. </div></div>
<h3>Configure SQL Server Source (OLEDB Source)</h3>
<ol>
<li>Open SSIS Package and drag Data Flow task from Control Flow SSIS Toolbox</li>
<li>Go to data flow designer. Drag and drop OLE DB Source</li>
<li>Open the OLE DB Source and configure
<div id="attachment_5981" style="width: 486px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5981" class="size-full wp-image-5981" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-oledb-source.png" alt="Salesforce using SSIS, Update OLEDB source" width="476" height="402" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-oledb-source.png 476w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-oledb-source-300x253.png 300w" sizes="(max-width: 476px) 100vw, 476px" /><p id="caption-attachment-5981" class="wp-caption-text">Salesforce using SSIS, Update OLEDB source</p></div></li>
</ol>
<h3>Configure SSIS Salesforce Source</h3>
<ol>
<li>Now lets Drag and drop <strong>ZS Salesforce Source</strong></li>
<li>Open the ZS Salesforce and configure. You can select <strong>Query Mode</strong> and enter query like this because we only care about two fields for now. Use query mode whenever possible because it transfers less data.<br />
<pre class="crayon-plain-tag">select Id,AccountNumber from account</pre>
<div id="attachment_5982" style="width: 896px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5982" class="size-full wp-image-5982" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-salesforce-source.png" alt="Salesforce using SSIS, Update Salesforce source" width="886" height="508" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-salesforce-source.png 886w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-salesforce-source-300x172.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-salesforce-source-768x440.png 768w" sizes="(max-width: 886px) 100vw, 886px" /><p id="caption-attachment-5982" class="wp-caption-text">Salesforce using SSIS, Update Salesforce source</p></div></li>
</ol>
<h3>Configure Sort Transforms</h3>
<p>Now lets sort both previous datasets using Sort Transforms. This is needed to JOIN dataset using Merge Transform (See next section)</p>
<ol>
<li>Drag and drop: 2 Sort and 1 Merge Join components</li>
<li>Connect the OLE DB Source to the <strong>first</strong> Sort component, and configure
<div id="attachment_5983" style="width: 719px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5983" class="size-full wp-image-5983" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-oledb-sort.png" alt="Salesforce using SSIS, Update OLEBD sort" width="709" height="330" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-oledb-sort.png 709w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-oledb-sort-300x140.png 300w" sizes="(max-width: 709px) 100vw, 709px" /><p id="caption-attachment-5983" class="wp-caption-text">Salesforce using SSIS, Update OLEBD sort</p></div></li>
<li>Connect the Salesforce Source to the <strong>second</strong> Sort component, and configure
<div id="attachment_5984" style="width: 720px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5984" class="size-full wp-image-5984" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-salesforce-sort.png" alt="Salesforce using SSIS,update Salesforce sort" width="710" height="332" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-salesforce-sort.png 710w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-salesforce-sort-300x140.png 300w" sizes="(max-width: 710px) 100vw, 710px" /><p id="caption-attachment-5984" class="wp-caption-text">Salesforce using SSIS,update Salesforce sort</p></div></li>
</ol>
<h3>Configure Merge Transforms</h3>
<p>No next step would be to join previous datasets based on AccountNumber and then we will output Id from Salesforce which is needed for later step.</p>
<ol>
<li>Drag and Drop Merge Transform from SSIS Toolbox like below.
<div id="attachment_6267" style="width: 448px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-merge-join-transform-toolbox-item.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6267" class="size-full wp-image-6267" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-merge-join-transform-toolbox-item.png" alt="Drag SSIS Merge Join Transform from Toolbox" width="438" height="340" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-merge-join-transform-toolbox-item.png 438w, https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-merge-join-transform-toolbox-item-300x233.png 300w" sizes="(max-width: 438px) 100vw, 438px" /></a><p id="caption-attachment-6267" class="wp-caption-text">Drag SSIS Merge Join Transform from Toolbox</p></div></li>
<li>Connect Sorts to the Merge component (<em>sort from OLEDB Source most be on the left</em>)</li>
<li>Configure the Merge component
<div id="attachment_5985" style="width: 771px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5985" class="size-full wp-image-5985" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-merge.png" alt="Salesforce using SSIS, update merge" width="761" height="714" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-merge.png 761w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-merge-300x281.png 300w" sizes="(max-width: 761px) 100vw, 761px" /><p id="caption-attachment-5985" class="wp-caption-text">Salesforce using SSIS, update merge</p></div></li>
</ol>
<h3>Configure SSIS Salesforce Destination for Bulk Update</h3>
<ol>
<li>Drag and drop <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-destination-connector/" target="_blank" rel="noopener">ZS Salesforce Destination</a></li>
<li>Open the ZS Salesforce Destination and configure</li>
<li>Connection Manager tab
<div id="attachment_5972" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5972" class="wp-image-5972 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager.png" alt="" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-5972" class="wp-caption-text">Salesforce using SSIS, update destination connection manager</p></div></li>
<li>Component Properties tab
<div id="attachment_5986" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5986" class="size-full wp-image-5986" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-destination-component-properties.png" alt="Salesforce using SSIS, update destination component properties" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-destination-component-properties.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-destination-component-properties-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-5986" class="wp-caption-text">Salesforce using SSIS, update destination component properties</p></div></li>
<li><div class="su-note"  style="border-color:#e5ae9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#ffc8b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">For Update purposes, Salesforce Destinations needs to map the ID from the Account object. For more information, please use the following link <a href="https://zappysys.zendesk.com/hc/en-us/articles/360008228693-SSIS-Salesforce-Destination-Update-Insert-with-Lookup-Fields-Text-to-Id-">SSIS Salesforce Destination &#8211; Update / Insert with Lookup Fields (Text to Id)</a> </div></div></li>
<li>Column Mapping
<div id="attachment_5987" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5987" class="size-full wp-image-5987" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-destination-column-mappings.png" alt="salesforce using SSIS, update destination column mappings" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-destination-column-mappings.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-destination-column-mappings-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-5987" class="wp-caption-text">salesforce using SSIS, update destination column mappings</p></div></li>
<li>Click OK</li>
<li>Drag and drop three <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=trash-destination.htm" target="_blank" rel="noopener">Trash Destination</a> components</li>
<li>Create two connections from ZS Salesforce Destination as follows: <strong>Update records and Error Output</strong></li>
<li>Right click on the joining arrows and enable data viewers on all previous connections</li>
<li>Save all changes</li>
<li>Right click in the data flow designer, click Execute Task
<div id="attachment_5988" style="width: 951px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5988" class="size-full wp-image-5988" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-results.png" alt="Salesforce using SSIS, update results" width="941" height="485" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-results.png 941w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-results-300x155.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-results-768x396.png 768w" sizes="(max-width: 941px) 100vw, 941px" /><p id="caption-attachment-5988" class="wp-caption-text">Salesforce using SSIS, update results</p></div></li>
</ol>
<h2>Bulk Upsert &#8211; Import/Modify data in Salesforce using SSIS</h2>
<p>In this section we&#8217;re going to perform a bulk upsert of 25 record&#8217;s on Salesforce using SSIS. Upsert is an operation that combines both insert an update.</p>
<p><a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-destination-connector/" target="_blank" rel="noopener">ZS Salesforce Destination</a> allows Upserts operations. You&#8217;ll need to select the Upsert as an action and indicate the Key value for the comparison.</p>
<h3>Creating External ID field for Salesforce Upsert</h3>
<p>For the Upsert action we have to use an Upsert Keyfield (i.e. External ID field). For more information read here <a href="https://help.salesforce.com/articleView?id=000005395&amp;language=en_US&amp;type=1">External ID</a>. Follow these steps to add a External ID field on Salesforce Accounts object:</p>
<ol>
<li>Login to your Salesforce account.</li>
<li>Click on the configuration icon and select &#8220;Service Setup&#8221;
<div id="attachment_6090" style="width: 382px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6090" class="wp-image-6090" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-upsert-keyfield-1.png" alt="salesforce-using-ssis-salesforce-edit-object" width="372" height="404" /><p id="caption-attachment-6090" class="wp-caption-text">Salesforce using SSIS, Salesforce edit object</p></div></li>
<li>On the new Tab, look for USER INTERFACE -&gt; Objects And Fields -&gt; Object Manager</li>
<li>Select Account object</li>
<li>Select Fields &amp; Relationships</li>
<li>Click New, to create a field
<div id="attachment_6091" style="width: 683px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6091" class="wp-image-6091 " src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-salesforce-fieldsandconfiguration.png" alt="salesforce-using-ssis-salesforce-fieldsandconfiguration" width="673" height="241" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-salesforce-fieldsandconfiguration.png 627w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-salesforce-fieldsandconfiguration-300x108.png 300w" sizes="(max-width: 673px) 100vw, 673px" /><p id="caption-attachment-6091" class="wp-caption-text">Salesforce using SSIS, Salesforce Fields &amp; Configuration</p></div></li>
<li>For the field type, choose Number and click next</li>
<li>For Field Label and Field Name, type TableID. Check Unique and External ID boxes and click next</li>
<li>Leave field-level security as default, click next</li>
<li>Leave page layouts as default, click next.</li>
<li>After finishing the configuration, the field should appear in the Fields &amp; Relationships page</li>
</ol>
<h3>Configure SQL Server Source</h3>
<ol>
<li>Open SSIS Package and drag Data Flow task from Control Flow SSIS Toolbox
<div id="attachment_8028" style="width: 470px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8028" class="size-full wp-image-8028" src="https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task.png" alt="" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /><p id="caption-attachment-8028" class="wp-caption-text">Dragging and dropping Data Flow Task into Control Flow</p></div></li>
<li>Go to data flow designer. Drag and drop OLE DB Source</li>
<li>Open the OLE DEB Source and configure as follow
<div id="attachment_5971" style="width: 489px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5971" class="size-full wp-image-5971" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-oledb-source.png" alt="Salesforce using SSIS, Upsert OLE DB source" width="479" height="408" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-oledb-source.png 479w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-oledb-source-300x256.png 300w" sizes="(max-width: 479px) 100vw, 479px" /><p id="caption-attachment-5971" class="wp-caption-text">Salesforce using SSIS, Upsert OLE DB source</p></div></li>
</ol>
<h3>Configure SSIS Salesforce Destination for Upsert</h3>
<ol>
<li>Drag and drop <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-destination-connector/" target="_blank" rel="noopener">ZS Salesforce Destination</a></li>
<li>Open the ZS Salesforce and configure</li>
<li>Connection Manager
<div id="attachment_5972" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5972" class="size-full wp-image-5972" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager.png" alt="" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-5972" class="wp-caption-text">Salesforce using SSIS, upsert destination connection manager</p></div></li>
<li>Component Properties
<div id="attachment_5973" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5973" class="size-full wp-image-5973" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-component-properties.png" alt="Salesforce using SSIS, upsert destination component properties" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-component-properties.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-component-properties-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-5973" class="wp-caption-text">Salesforce using SSIS, upsert destination component properties</p></div></li>
<li>Column Mapping
<div id="attachment_5974" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5974" class="size-full wp-image-5974" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-column-mapping.png" alt="salesforce using SSIS, upsert destination column mapping" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-column-mapping.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-column-mapping-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-5974" class="wp-caption-text">salesforce using SSIS, upsert destination column mapping</p></div></li>
<li>Click OK</li>
<li>Drag and drop three <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=trash-destination.htm" target="_blank" rel="noopener">Trash Destination</a> components</li>
</ol>
<h3>Configure Error Handling, Outputs for New, Updated, Failed Records</h3>
<p>If you like to capture which rows are inserted and which rows are updated then you can drag Blue arrows coming from Salesforce destination component. You can also connect Red arrow to detect failed records and reason for error.</p>
<ol>
<li>Connect ZS Salesforce Destination for: New records Output, Updated Records Output and Error Output</li>
<li>Right click on the joining arrows and enable data viewers on all previous connections</li>
<li>Right click in the data flow designer, click Execute Task
<div id="attachment_5975" style="width: 1131px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5975" class="size-full wp-image-5975" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-results.png" alt="Salesforce using SSIS, upsert results" width="1121" height="485" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-results.png 1121w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-results-300x130.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-results-768x332.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-results-1024x443.png 1024w" sizes="(max-width: 1121px) 100vw, 1121px" /><p id="caption-attachment-5975" class="wp-caption-text">Salesforce using SSIS, upsert results</p></div></li>
</ol>
<h2>Bulk Delete &#8211; Delete data in Salesforce using SSIS</h2>
<p>In this section, we&#8217;re going to perform a bulk delete on Salesforce using SSIS <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-destination-connector/" target="_blank" rel="noopener">ZS Salesforce Destination</a>. In this example we&#8217;re going to list all our source customers (from previous sections), merge it wit the Salesforce Account object, retrieve the Salesforce Account Id and delete the rows. Delete Operation also requires to map Id field so we will use similar technique we used for Update.</p>
<h3>Configure SQL Server Source (OLEDB Source)</h3>
<ol>
<li>Go to data flow designer. Drag and drop OLE DB Source</li>
<li>Open the OLE DEB Source and configure as follow
<div id="attachment_6020" style="width: 516px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6020" class="size-full wp-image-6020" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-oledb-source.png" alt="" width="506" height="406" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-oledb-source.png 506w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-oledb-source-300x241.png 300w" sizes="(max-width: 506px) 100vw, 506px" /><p id="caption-attachment-6020" class="wp-caption-text">salesforce-using-ssis-delete-oledb-source</p></div></li>
</ol>
<h3>Configure SSIS Salesforce Source</h3>
<ol>
<li>Drag and drop <strong>ZS Salesforce Source</strong></li>
<li>Open the ZS Salesforce and configure.</li>
<li>You can select <strong>Query Mode</strong> and enter query like this because we only care about two fields for now. Use query mode whenever possible because it transfers less data.<br />
<pre class="crayon-plain-tag">select Id,AccountNumber from account</pre>
</li>
</ol>
<h3>Configure Sort Transforms</h3>
<p>Now lets sort both previous datasets using Sort Transforms. This is needed to JOIN dataset using Merge Transform (See next section)</p>
<ol>
<li>Drag and drop: 2 Sort and 1 Merge Join components</li>
<li>Connect the OLE DB Source to the <strong>first</strong> Sort component, and configure
<div id="attachment_5983" style="width: 719px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5983" class="size-full wp-image-5983" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-oledb-sort.png" alt="Salesforce using SSIS, Update OLEBD sort" width="709" height="330" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-oledb-sort.png 709w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-oledb-sort-300x140.png 300w" sizes="(max-width: 709px) 100vw, 709px" /><p id="caption-attachment-5983" class="wp-caption-text">Salesforce using SSIS, Update OLEBD sort</p></div></li>
<li>Connect the Salesforce Source to the <strong>second</strong> Sort component, and configure
<div id="attachment_5984" style="width: 720px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5984" class="size-full wp-image-5984" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-salesforce-sort.png" alt="Salesforce using SSIS,update Salesforce sort" width="710" height="332" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-salesforce-sort.png 710w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-salesforce-sort-300x140.png 300w" sizes="(max-width: 710px) 100vw, 710px" /><p id="caption-attachment-5984" class="wp-caption-text">Salesforce using SSIS,update Salesforce sort</p></div></li>
</ol>
<h3>Configure Merge Transforms</h3>
<p>No next step would be to join previous datasets based on AccountNumber and then we will output Id from Salesforce which is needed for later step.</p>
<ol>
<li>Now drag Merge Transform from SSIS toolbox
<div id="attachment_6267" style="width: 448px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-merge-join-transform-toolbox-item.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6267" class="size-full wp-image-6267" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-merge-join-transform-toolbox-item.png" alt="Drag SSIS Merge Join Transform from Toolbox" width="438" height="340" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-merge-join-transform-toolbox-item.png 438w, https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-merge-join-transform-toolbox-item-300x233.png 300w" sizes="(max-width: 438px) 100vw, 438px" /></a><p id="caption-attachment-6267" class="wp-caption-text">Drag SSIS Merge Join Transform from Toolbox</p></div></li>
<li>Connect both Sort to the Merge component (<em>sort from OLEDB Source most be on the left</em>)</li>
<li>Configure the Merge component
<div id="attachment_6021" style="width: 749px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6021" class="size-full wp-image-6021" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-merge.png" alt="" width="739" height="375" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-merge.png 739w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-merge-300x152.png 300w" sizes="(max-width: 739px) 100vw, 739px" /><p id="caption-attachment-6021" class="wp-caption-text">salesforce-using-ssis-delete-merge</p></div></li>
</ol>
<h3>Configure SSIS Salesforce Destination for Bulk Delete</h3>
<ol>
<li>Drag and drop <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-destination-connector/" target="_blank" rel="noopener">ZS Salesforce Destination</a></li>
<li>Connect the Merge and <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-destination-connector/" target="_blank" rel="noopener">ZS Salesforce Destination</a> components. Right click the arrow and enable data viewer</li>
<li>Connection Manager tab
<div id="attachment_5972" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5972" class="wp-image-5972 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager.png" alt="" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-5972" class="wp-caption-text">Salesforce using SSIS, delete destination connection manager</p></div></li>
<li>Component Properties tab
<div id="attachment_6022" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6022" class="wp-image-6022 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-destination-component-properties.png" alt="" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-destination-component-properties.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-destination-component-properties-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-6022" class="wp-caption-text">Salesforce using SSIS, delete destination component properties</p></div></li>
<li><div class="su-note"  style="border-color:#e5ae9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#ffc8b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">For Delete purposes, Salesforce Destinations needs to map the ID from the Account object.For more information, please use the following link <a href="https://zappysys.zendesk.com/hc/en-us/articles/360008228693-SSIS-Salesforce-Destination-Update-Insert-with-Lookup-Fields-Text-to-Id-">SSIS Salesforce Destination &#8211; Update / Insert with Lookup Fields (Text to Id)</a> </div></div></li>
<li>Column Mapping
<div id="attachment_6025" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6025" class="size-full wp-image-6025" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-destination-column-mapping.png" alt="" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-destination-column-mapping.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-destination-column-mapping-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-6025" class="wp-caption-text">salesforce-using-ssis-delete-destination-column-mapping</p></div></li>
<li>Click OK</li>
<li>Save all changes</li>
<li>Right click in the data flow designer, click Execute Task
<div id="attachment_6023" style="width: 908px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6023" class="size-full wp-image-6023" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-results.png" alt="" width="898" height="487" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-results.png 898w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-results-300x163.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-results-768x416.png 768w" sizes="(max-width: 898px) 100vw, 898px" /><p id="caption-attachment-6023" class="wp-caption-text">salesforce-using-ssis-delete-results</p></div></li>
</ol>
<h2>Error Handling</h2>
<p>When working on Salesforce with SSIS, we recommend <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=trash-destination.htm" target="_blank" rel="noopener">Trash Destination</a> component to help debugging outputs without performing DML on destinations.</p>
<p>Main benefits of usage:</p>
<ol>
<li>Enable data viewers and get live feedback of the data</li>
<li>Save the results on different formats (<em>XML, JSON, plain text files</em>).</li>
</ol>
<h2>Conclusion</h2>
<p>In this article, We have seen how easy it is to integrate Salesforce using SSIS. Using drag and drop connector you can perform Bulk insert, update, delete and Upsert operations.</p>
<p>Download <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a> to learn more about other possible scenarios which are not discussed in this article.</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/loading-data-salesforce-using-ssis-bulk-insert-update-delete/">Load data in Salesforce using SSIS  – Insert, Upsert, Delete, Update</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Read Salesforce Marketing Cloud data in SSIS (ExactTarget API)</title>
		<link>https://zappysys.com/blog/read-salesforce-marketing-cloud-data-ssis-exacttarget-api/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 05 Sep 2018 21:30:16 +0000</pubDate>
				<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS REST API Task]]></category>
		<category><![CDATA[ExactTarget]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[salesforce]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=4747</guid>

					<description><![CDATA[<p>Introduction In this post we will learn how to call Salesforce Marketing Cloud API using SSIS and load into SQL Server. We will show you use case of SSIS REST API Task  and SSIS JSON Source Basically there are two steps to call Salesforce Marketing Cloud API Obtain ClientID and ClientSecret ( Check these steps ) Get Access Token by [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-salesforce-marketing-cloud-data-ssis-exacttarget-api/">Read Salesforce Marketing Cloud data in SSIS (ExactTarget API)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180.png"><img loading="lazy" decoding="async" class=" wp-image-1764 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180.png" alt="" width="156" height="156" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180.png 180w, https://zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180-150x150.png 150w" sizes="(max-width: 156px) 100vw, 156px" /></a>In this post we will learn how to call Salesforce Marketing Cloud API using SSIS and load into SQL Server. We will show you use case of <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">SSIS REST API Task</a>  and <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">SSIS JSON Source</a></p>
<p>Basically there are two steps to call Salesforce Marketing Cloud API</p>
<ol>
<li style="text-align: left;">Obtain ClientID and ClientSecret ( <a href="https://developer.salesforce.com/docs/atlas.en-us.mc-app-development.meta/mc-app-development/api-integration.htm" target="_blank" rel="noopener">Check these steps</a> )</li>
<li style="text-align: left;">Get Access Token by calling <a href="https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-getting-started.meta/mc-getting-started/requestToken.htm" target="_blank" rel="noopener">requestToken API call</a></li>
<li style="text-align: left;">Once you have token you can call any other API endpoints to read / edit / update Marketing Cloud data. You must supply Token inside Authorization Header along with each call.</li>
</ol>
<div class="su-note"  style="border-color:#e5da9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff4b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">NOTE: Salesforce Marketing Cloud is formally known as ExactTarget</div></div>
<h2><span id="Requirements">Requirements</span></h2>
<p>Before we look into Step-By-Step section to call Salesforce Marketing API (Exacttarget) make sure you met the following requirements.</p>
<ol>
<li>SSIS designer installed. Sometimes it is referred as BIDS or SSDT (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from Microsoft site</a>).</li>
<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
<li><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack installed</a>. Click on the link to download a FREE trial.</li>
<li>You have access to Salesforce Marketing Cloud and you have correct permission to create access key (or just ask Salesforce Admin to generate it for you <a href="https://developer.salesforce.com/docs/atlas.en-us.mc-app-development.meta/mc-app-development/api-integration.htm" target="_blank" rel="noopener">Check these steps</a> )</li>
</ol>
<h2>Getting Started</h2>
<p>Now let&#8217;s look at step by step approach on how to read salesforce marketing data in SSIS.</p>
<h3>Step-1 : Get Access Token for Salesforce Marketing Cloud API call</h3>
<p>First step is to get token for Marketing Cloud API calls. We have to <a href="https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-getting-started.meta/mc-getting-started/requestToken.htm" target="_blank" rel="noopener">call this API</a> to obtain token. This token typically lasts for one hour or so (3600 seconds).</p>
<p>Before we call below steps make sure you have obtained ClientID and ClientSecret ( <a href="https://developer.salesforce.com/docs/atlas.en-us.mc-app-development.meta/mc-app-development/api-integration.htm" target="_blank" rel="noopener">Check these steps</a> ).</p>
<ol>
<li>Download and <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">install SSIS PowerPack</a></li>
<li>Open SSIS Package</li>
<li>Drag <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">ZS REST API Task</a> from the SSIS Toolbox on Control Flow designer.</li>
<li>Rename task to call it <strong>Get Token</strong></li>
<li>Double click to edit as below.<br />
<strong>Production URL:</strong><br />
<pre class="crayon-plain-tag">https://auth.exacttargetapis.com/v1/requestToken</pre>
Sandbox URL:<br />
<pre class="crayon-plain-tag">https://auth-test.exacttargetapis.com/v1/requestToken</pre>
<div style="width: 1028px" class="wp-caption alignnone"><img loading="lazy" decoding="async" src="https://zappysys.zendesk.com/hc/article_attachments/360013125313/salesforce-marketing-cloud-get-access-token-ssis-rest-api-call.png" alt="Get API Token for Salesforce Marketing Cloud API calls" width="1018" height="634" /><p class="wp-caption-text">Get API Token for Salesforce Marketing Cloud API calls</p></div></li>
<li>Go to response setting tab and change Response Type to JSON and set expression as <strong>$.accessToken </strong>, Check Save response and Select Variable <strong>&lt;New Variable&gt;</strong> (e.g. <strong>vToken</strong>)
<div style="width: 699px" class="wp-caption alignnone"><img loading="lazy" decoding="async" src="https://zappysys.zendesk.com/hc/article_attachments/360013126053/ssis-salesforce-marketing-api-call-get-token-json-expression.png" alt="Configure Response Tab - Extract API Token for Salesforce Marketing Cloud API calls" width="689" height="374" /><p class="wp-caption-text">Configure Response Tab &#8211; Extract API Token for Salesforce Marketing Cloud API calls</p></div></li>
<li> Now Click Test Request/Response to confirm you get token. Copy Token from Bottom panel and click OK to save UI</li>
<li>Now right click in designer and click &#8220;Variables&#8221; and paste Token we got in previous step in the Value (This token is good for one hour only so update if it expires). This manual update is only needed while you designing page&#8230; and testing data Preview / get metadata (see Next Section).  When you run full package it will get fresh token each time and ignore Hardcoded token from Variable.</li>
</ol>
<h3>Step-2 : Read data from Salesforce Marketing Cloud API (SSIS JSON Source)</h3>
<p>Now once we have token extract step done. We can move to next step which is to read actual data from <strong>Exacttarget API</strong> (i.e. Salesforce Marketing Cloud API)</p>
<p>We will us <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">SSIS JSON Source</a> to read data (JSON format) and save to SQL Server.</p>
<ol>
<li>Drag data flow task from SSIS Toolbox and drop to control flow surface.</li>
<li>Rename Data flow to <strong>Get Data </strong>or <strong>Call Data</strong></li>
<li>Connect first step (Get Token) to data flow</li>
<li>Double click task and from data flow toolbox drag  <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">ZS JSON Source</a> on the surface</li>
<li>Double click JSON Source and configure as below.</li>
<li>Click ON <strong>Select Filter</strong> Button and Select Correct filter&#8230; (Make sure select only Array Node icon to extract correct data)</li>
<li>Click Preview to confirm</li>
<li>Click OK to save</li>
<li>Connect JSON source to some target (e.g. OLEDB Destination for SQL Server)</li>
<li>Run your package</li>
</ol>
<div style="width: 716px" class="wp-caption alignnone"><img loading="lazy" decoding="async" src="https://zappysys.zendesk.com/hc/article_attachments/360013127413/ssis-read-salesforce-marketing-cloud-to-sql-server-exacttarget.png" alt="Read Salesforce Marketing Cloud data in SSIS and load into SQL Server (Using SSIS JSON Source)" width="706" height="625" /><p class="wp-caption-text">Read Salesforce Marketing Cloud data in SSIS and load into SQL Server (Using SSIS JSON Source)</p></div>
<h2>Using HTTP Connection (New version &#8211; Single Step)</h2>
<p>If you are using a new version (with HTTP &#8211; Dynamic Token Support), then you can try the following option.</p>
<ol>
<li>On JSON Source Check Use Credentials and choose HTTP connection.
<div id="attachment_11119" style="width: 600px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/read-salesforce-marketing-cloud-ssis.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11119" class="size-full wp-image-11119" src="https://zappysys.com/blog/wp-content/uploads/2018/09/read-salesforce-marketing-cloud-ssis.png" alt="" width="590" height="290" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/read-salesforce-marketing-cloud-ssis.png 590w, https://zappysys.com/blog/wp-content/uploads/2018/09/read-salesforce-marketing-cloud-ssis-300x147.png 300w" sizes="(max-width: 590px) 100vw, 590px" /></a><p id="caption-attachment-11119" class="wp-caption-text">Read Salesforce Martketing Cloud Data using REST API (in SSIS)</p></div></li>
<li>On the HTTP Connection, choose the following settings
<ol>
<li>For URL enter <pre class="crayon-plain-tag">https://auth.exacttargetapis.com/hub/v1/campaigns/</pre></li>
<li>Choose Dynamic Token Auth</li>
<li>Enter Client ID (same as the previous section)</li>
<li>Enter Client Secret  (same as the previous section)</li>
<li>Click the Configure Dynamic Token link
<div id="attachment_11117" style="width: 614px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/salesforce-marketing-cloud-access-token-authentication.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11117" class="size-full wp-image-11117" src="https://zappysys.com/blog/wp-content/uploads/2018/09/salesforce-marketing-cloud-access-token-authentication.png" alt="" width="604" height="297" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/salesforce-marketing-cloud-access-token-authentication.png 604w, https://zappysys.com/blog/wp-content/uploads/2018/09/salesforce-marketing-cloud-access-token-authentication-300x148.png 300w" sizes="(max-width: 604px) 100vw, 604px" /></a><p id="caption-attachment-11117" class="wp-caption-text">Salesforce Marketing Cloud API Call in SSIS Using HTTP Connection (Dynamic Token Method)</p></div></li>
</ol>
</li>
<li> Now on the Dynamic Token Tab configure like below (<strong>Request Settings Tab</strong>)
<ol>
<li>Make sure you are on Request Settings Tab</li>
<li>Enter token endpoint URL<br />
<pre class="crayon-plain-tag">https://auth.exacttargetapis.com/v1/requestToken</pre>
</li>
<li>Set Request Method (<strong>POST</strong>)</li>
<li>Select Content Type (<strong>application/json</strong>)</li>
<li>Enter Body like below<br />
<pre class="crayon-plain-tag">{ clientId: "[$userid$]",clientSecret: "&lt;&lt;[$password$],FUN_JSONENC&gt;&gt;" }</pre>
</li>
<li>Click on Response Settings Tab
<div id="attachment_11118" style="width: 668px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/salesforce-marketing-cloud-access-token-authentication-request.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11118" class="size-full wp-image-11118" src="https://zappysys.com/blog/wp-content/uploads/2018/09/salesforce-marketing-cloud-access-token-authentication-request.png" alt="" width="658" height="469" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/salesforce-marketing-cloud-access-token-authentication-request.png 658w, https://zappysys.com/blog/wp-content/uploads/2018/09/salesforce-marketing-cloud-access-token-authentication-request-300x214.png 300w" sizes="(max-width: 658px) 100vw, 658px" /></a><p id="caption-attachment-11118" class="wp-caption-text">Salesforce Marketing Cloud API Call in SSIS Using HTTP Connection (Dynamic Token &#8211; Request Settings)</p></div></li>
</ol>
</li>
<li>On the <strong>Response Settings Tab</strong> configure like below
<ol>
<li>Select <strong>Extract From Body</strong></li>
<li>Expression Type as <strong>Json</strong></li>
<li>Enter expression <pre class="crayon-plain-tag"><span class="lang:default decode:true crayon-inline ">$.accessToken</pre></span>
<div id="attachment_11121" style="width: 382px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/salesforce-marketing-cloud-access-token-authentication-response.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11121" class="size-full wp-image-11121" src="https://zappysys.com/blog/wp-content/uploads/2018/09/salesforce-marketing-cloud-access-token-authentication-response.png" alt="Salesforce Marketing Cloud API Call in SSIS Using HTTP Connection (Dynamic Token - Response Settings)" width="372" height="190" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/salesforce-marketing-cloud-access-token-authentication-response.png 372w, https://zappysys.com/blog/wp-content/uploads/2018/09/salesforce-marketing-cloud-access-token-authentication-response-300x153.png 300w" sizes="(max-width: 372px) 100vw, 372px" /></a><p id="caption-attachment-11121" class="wp-caption-text">Salesforce Marketing Cloud API Call in SSIS Using HTTP Connection (Dynamic Token &#8211; Response Settings)</p></div></li>
</ol>
</li>
<li>Click OK and you can preview your API data on JSON Source<br />
Example: https://auth.exacttargetapis.com/hub/v1/campaigns/</li>
<li>If you use HTTP COnnection with Dynamic Token you do not need two step approach we did in the previous section</li>
</ol>
<div class="content_block" id="custom_post_widget-2516"><h2><span id="Debug_Web_API_call_using_Fiddler">Debug Web API call using Fiddler</span></h2>
To test how things looking behind the scene we strongly suggest to use <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">tool like  fiddler</a>.

You can double click the URL entry (Right side) to see Request and Response Panels. Top panel is Request (URL, Headers, Body) and Bottom Panel is Response.
<div id="attachment_2344" class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?ssl=1"><img loading="lazy" decoding="async" class="size-full wp-image-2344" style="border: 0px; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.176) 0px 1px 2px;" src="https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?resize=720%2C316&amp;ssl=1" sizes="(max-width: 720px) 100vw, 720px" srcset="https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?w=1287&amp;ssl=1 1287w, https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?resize=300%2C131&amp;ssl=1 300w, https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?resize=768%2C337&amp;ssl=1 768w, https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?resize=1024%2C449&amp;ssl=1 1024w" alt="Debugging Web API call using Fiddler in SSIS" width="702" height="308" data-attachment-id="2344" data-permalink="https://zappysys.com/blog/pass-authorization-header-redirected-location/ssis-rest-api-call-debug-via-fiddler/#main" data-orig-file="https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?fit=1287%2C564&amp;ssl=1" data-orig-size="1287,564" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="ssis-rest-api-call-debug-via-fiddler" data-image-description="&lt;p&gt;Debugging Web API call using Fiddler in SSIS&lt;/p&gt; " data-medium-file="https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?fit=300%2C131&amp;ssl=1" data-large-file="https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?fit=720%2C316&amp;ssl=1" /></a>
<p class="wp-caption-text">Debugging Web API call using Fiddler in SSIS</p>

</div>
<h2><span id="Loadingdata_fromREST_API_to_SQL_Server">Loading <span id="Loading_Graph_API_Office_365_data_to_SQL_Server">data from </span>REST API to SQL Server</span></h2>
Once you setup HTTP / OAUTH connection we can use <strong>JSON Source</strong> or <strong>XML Source</strong> to extract data from API and  load into SQL Server. If you are API is XML based API then use XML Source in below examples else use JSON Source.

For example purpose we will load data into SQL Server but you can load into any Target (e.g. Flat file, Oracle, Excel) using Microsoft or ZappySys Destination connectors

To load REST API data into SQL Server perform the following steps (<strong>Screenshots are generic</strong> and used for demonstration for purpose, <strong>your values can be different</strong> than below)
<ol>
 	<li>Go to SSIS Data Flow tab</li>
 	<li>Drag <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">ZS JSON Source</a> from the SSIS Toolbox (Use <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-source/" target="_blank" rel="noopener">ZS XML Source</a> if your API is XML based API)</li>
 	<li>Double click to edit Source</li>
 	<li>Set API URL you like to call, Check Use Credentials if you need to use HTTP or OAuth connection</li>
 	<li>Set Method / Body if its other than GET. For method other than GET make sure you select correct <strong>Content-Type</strong> from Dropdown (e.g. <strong>application/json</strong>). This indicate input data format in Body.</li>
 	<li>Set <strong>HTTP Headers</strong> if needed (in Most cases you won't need to set this)</li>
 	<li>Select Filter (many times this is not needed). If your API response has array node then select it here. For example if your response looks like this <strong>{ rows: [ {...}, {...}, {...} ] }</strong> then filter would be <strong>$.rows[*]</strong>. Select Array node you like to extract in the Filter selection UI.

<a href="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-get-data-google-bigquery-select-json-filter.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1573" src="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-get-data-google-bigquery-select-json-filter.png" alt="" width="675" height="363" srcset="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-get-data-google-bigquery-select-json-filter.png 675w, https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-get-data-google-bigquery-select-json-filter-300x161.png 300w" sizes="(max-width: 675px) 100vw, 675px" /></a></li>
 	<li><a href="https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/" target="_blank" rel="noopener">Configure Pagination</a> if needed on the pagination tab. Check your API documentation see it supports pagination.</li>
 	<li>Click OK to Save component settings and generate <a href="https://zappysys.com/blog/handling-ssis-component-metadata-issues/" target="_blank" rel="noopener">desired metadata / columns for the output</a>.</li>
 	<li>Now drag <strong>OLEDB destination</strong> from the SSIS toolbox and drop on the Data Flow surface (technically you can use any valid Destination but for demo we will use OLEDB Destination)</li>
 	<li>Connect Source to Destination Component</li>
 	<li>On OLEDB destination select / create new SQL Connection and then Click "<strong>New Table</strong>"</li>
 	<li>Click on <strong>Mappings tab</strong> to map columns by names and click OK to save</li>
 	<li>Execute the Package</li>
</ol>
<div id="attachment_1617" class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-xero-to-sql-server-data-load.png"><img loading="lazy" decoding="async" class="size-full wp-image-1617" style="border: 0px; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.176) 0px 1px 2px;" src="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-xero-to-sql-server-data-load.png?resize=720%2C546" sizes="(max-width: 720px) 100vw, 720px" srcset="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-xero-to-sql-server-data-load.png?w=782 782w, https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-xero-to-sql-server-data-load.png?resize=300%2C227 300w, https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-xero-to-sql-server-data-load.png?resize=768%2C582 768w" alt="Configure SSIS OLEDB Destination - Loading Xero Data into SQL Server Table" width="702" height="532" data-attachment-id="1617" data-permalink="https://zappysys.com/blog/reading-loading-data-in-xero-sql-server-ssis/ssis-xero-to-sql-server-data-load/#main" data-orig-file="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-xero-to-sql-server-data-load.png?fit=782%2C593&amp;ssl=1" data-orig-size="782,593" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="ssis-xero-to-sql-server-data-load" data-image-description="&lt;p&gt;Configure SSIS OLEDB Destination – Loading Xero Data into SQL Server Table&lt;/p&gt; " data-medium-file="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-xero-to-sql-server-data-load.png?fit=300%2C227&amp;ssl=1" data-large-file="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-xero-to-sql-server-data-load.png?fit=720%2C546&amp;ssl=1" /></a>
<p class="wp-caption-text">Configure SSIS OLEDB Destination – Loading REST API Data into SQL Server Table</p>

</div>
<div id="attachment_1618" class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-xero-sql-server-load-mappings.png"><img loading="lazy" decoding="async" class="size-full wp-image-1618" style="border: 0px; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.176) 0px 1px 2px;" src="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-xero-sql-server-load-mappings.png?resize=720%2C533" sizes="(max-width: 720px) 100vw, 720px" srcset="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-xero-sql-server-load-mappings.png?w=734 734w, https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-xero-sql-server-load-mappings.png?resize=300%2C222 300w" alt="Xero to SQL Server Column Mappings for OLEDB Destination" width="702" height="519" data-attachment-id="1618" data-permalink="https://zappysys.com/blog/reading-loading-data-in-xero-sql-server-ssis/ssis-xero-sql-server-load-mappings/#main" data-orig-file="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-xero-sql-server-load-mappings.png?fit=734%2C543&amp;ssl=1" data-orig-size="734,543" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="ssis-xero-sql-server-load-mappings" data-image-description="&lt;p&gt;Xero to SQL Server Column Mappings for OLEDB Destination&lt;/p&gt; " data-medium-file="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-xero-sql-server-load-mappings.png?fit=300%2C222&amp;ssl=1" data-large-file="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-xero-sql-server-load-mappings.png?fit=720%2C533&amp;ssl=1" /></a>
<p class="wp-caption-text">REST API to SQL Server Column Mappings for OLEDB Destination</p>

</div>
<div id="attachment_1619" class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-loading-data-from-xero-to-sql-server.png"><img loading="lazy" decoding="async" class="size-full wp-image-1619" style="border: 0px; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.176) 0px 1px 2px;" src="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-loading-data-from-xero-to-sql-server.png?resize=283%2C391" sizes="(max-width: 283px) 100vw, 283px" srcset="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-loading-data-from-xero-to-sql-server.png?w=283 283w, https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-loading-data-from-xero-to-sql-server.png?resize=217%2C300 217w" alt="Loading Xero data to SQL Server in SSIS" width="275" height="380" data-attachment-id="1619" data-permalink="https://zappysys.com/blog/reading-loading-data-in-xero-sql-server-ssis/ssis-loading-data-from-xero-to-sql-server/#main" data-orig-file="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-loading-data-from-xero-to-sql-server.png?fit=283%2C391&amp;ssl=1" data-orig-size="283,391" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="ssis-loading-data-from-xero-to-sql-server" data-image-description="&lt;p&gt;Loading Xero data to SQL Server in SSIS&lt;/p&gt; " data-medium-file="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-loading-data-from-xero-to-sql-server.png?fit=217%2C300&amp;ssl=1" data-large-file="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-loading-data-from-xero-to-sql-server.png?fit=283%2C391&amp;ssl=1" /></a>
<p class="wp-caption-text">Loading REST API to SQL Server in SSIS</p>

</div>
<h2><span id="POST_Data_to_ServiceNow_API_Insert_Update_or_Delete">POST / Write Data to API (Insert, Update or Delete)</span></h2>
There will be a time you like to automate POST actions (e.g. create new incident via API call). <a href="https://zappysys.com/blog/http-post-in-ssis-send-data-to-web-api-url-json-xml/" target="_blank" rel="noopener">Check this article</a> to learn more on how to POST , DELETE, PUT data using API calls
<h2><span id="Common_Errors">Common Errors</span></h2>
There are many error can occur during runtime. Here are most common errors you may face at runtime.
<div id="custom_post_widget-1887" class="content_block">
<h3><span id="Truncation_related_error">Truncation related error</span></h3>
The most common error you may face when you run a SSIS package is truncation error. During the design time only 300 rows are scanned from a source (a file or a REST API call response) to detect datatypes but at runtime it is likely you will retrieve far more records. So it is possible that you will get longer strings than initially expected. For detailed instructions how to fix common metadata related errors read an article "<a href="https://zappysys.com/blog/handling-ssis-component-metadata-issues/" target="_blank" rel="noopener">How to handle SSIS errors (truncation, metadata issues)</a>".
<h3><span id="Authentication_related_error">Authentication related error</span></h3>
Another frequent error you may get is authentication error, which happens when you deploy/copy a package to another machine and run it there. Check <a href="https://zappysys.com/blog/loading-data-from-rest-api-to-sql-server-in-ssis/#Deployment_to_Production">Deployment to Production</a> below to see why it happens and how to solve this problem.

</div>
<h2><span id="Deployment_to_Production">Deployment to Production</span></h2>
<div id="custom_post_widget-1932" class="content_block">In SSIS package <a href="https://docs.microsoft.com/en-us/sql/integration-services/security/access-control-for-sensitive-data-in-packages" target="_blank" rel="noopener">sensitive data such as tokens and passwords are by default encrypted by SSIS</a> with your Windows account which you use to create a package. So SSIS will fail to decrypt tokens/passwords, when you run it from another machine using another Windows account. To circumvent this when you are creating a SSIS package which uses authentication components (e.g. an <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-oauth-connection-manager.htm" target="_blank" rel="noopener">OAuth Connection Manager</a> or an <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-http-connection-manager.htm" target="_blank" rel="noopener">HTTP Connection Manager</a> with credentials, etc.), consider using parameters/variables to pass tokens/passwords. In this way you won’t face authentication related errors when package is deployed to a production server. Check our article on <a href="https://zappysys.com/blog/how-to-run-an-ssis-package-with-sensitive-data-on-sql-server/" target="_blank" rel="noopener">how to configure packages with sensitive data on your production or development server</a>.</div></div>
<p>The post <a href="https://zappysys.com/blog/read-salesforce-marketing-cloud-data-ssis-exacttarget-api/">Read Salesforce Marketing Cloud data in SSIS (ExactTarget API)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Read from Salesforce Custom Reports in SSIS / ODBC</title>
		<link>https://zappysys.com/blog/read-salesforce-custom-reports-ssis-odbc/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 11 Jul 2018 19:21:11 +0000</pubDate>
				<category><![CDATA[JSON File / REST API Driver]]></category>
		<category><![CDATA[REST API]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS Salesforce Connection]]></category>
		<category><![CDATA[odbc]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[salesforce]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=4414</guid>

					<description><![CDATA[<p>Introduction In our previous posts we saw how to read and write Salesforce Data using SSIS Salesforce Connectors (Source /Destination). It covered how to read salesforce data from Tables and SOQL query but it does not support reading from reports. So now in this post we will see how to read Salesforce data from Custom Reports [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-salesforce-custom-reports-ssis-odbc/">Read from Salesforce Custom Reports in SSIS / ODBC</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180.png"><img loading="lazy" decoding="async" class=" wp-image-1764 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180.png" alt="" width="107" height="107" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180.png 180w, https://zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180-150x150.png 150w" sizes="(max-width: 107px) 100vw, 107px" /></a>In our previous posts we saw how to <a href="https://zappysys.com/blog/export-data-from-salesforce-to-sql-server-using-ssis/" target="_blank" rel="noopener">read</a> and <a href="https://zappysys.com/blog/loading-data-salesforce-using-ssis-bulk-insert-update-delete/" target="_blank" rel="noopener">write</a> Salesforce Data using SSIS Salesforce Connectors (Source /Destination). It covered how to read salesforce data from Tables and SOQL query but it does not support reading from reports. So now in this post we will see <strong>how to read Salesforce data from Custom Reports in SSIS</strong> which will use <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">JSON Source</a> rather than <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-source-connector/" target="_blank" rel="noopener">Salesforce Source</a>.</p>
<p>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.</p>
<p>So let&#8217;s get started!!!</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2></h2>
<h2>Read Salesforce Custom Reports in SSIS</h2>
<p>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 <a href="https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_basic_info.htm" target="_blank" rel="noopener">sobjects</a> to get all table information) .</p>
<p>So lets get started.</p>
<ol>
<li>In case you missed the previous section, You need to <b>Download and Install</b> SSIS <a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">ZappySys PowerPack.</a></li>
<li>Once you finished first step, Open Visual Studio and Create New SSIS Package Project.</li>
<li>Now, Drag and Drop SSIS <b>Data Flow Task</b> from SSIS Toolbox.<br />
<img decoding="async" class="figureimage" title="SSIS Data Flow Task - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/drag-and-drop-data-flow-task.png" alt="SSIS Data Flow Task - Drag and Drop" /></li>
<li>Double click on the Data Flow task to see Data Flow designer surface.</li>
<li>From the SSIS toolbox drag and drop JSON Source on the Data Flow designer surface.<br />
<img decoding="async" class="figureimage" title="SSIS JSON Source - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/json-source/ssis-json-source-adapter-drag.png" alt="SSIS JSON Source - Drag and Drop" /></li>
<li>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.<br />
<pre class="crayon-plain-tag">https://YOUR-ORG-INSTANCE.salesforce.com/services/data/v64.0/analytics/reports/YOUR-REPORT-ID</pre>
<strong>Example URLs</strong><br />
<pre class="crayon-plain-tag">Using Salesforce Org Domain:
https://zappysys21.salesforce.com/services/data/v64.0/analytics/reports/00O61000001a97n

Using Personal Lighting/My Domain (works when [My Domain] feature enabled):
https://zappysys21.my.salesforce.com/services/data/v64.0/analytics/reports/00O61000001a97n

Using Direct Pod/Instance URL:
https://na34.salesforce.com/services/data/v64.0/analytics/reports/00O61000001a97n</pre>
</li>
<li>Check Use Credentials and configure Salesforce Connection
<div id="attachment_8918" style="width: 602px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/create-ssis-rest-api-connection-connect-http-oauth-salesforce.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8918" class="size-full wp-image-8918" src="https://zappysys.com/blog/wp-content/uploads/2018/07/create-ssis-rest-api-connection-connect-http-oauth-salesforce.png" alt="Create new REST API Connection in SSIS (For JSON, XML or CSV Source)" width="592" height="215" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/create-ssis-rest-api-connection-connect-http-oauth-salesforce.png 592w, https://zappysys.com/blog/wp-content/uploads/2018/07/create-ssis-rest-api-connection-connect-http-oauth-salesforce-300x109.png 300w" sizes="(max-width: 592px) 100vw, 592px" /></a><p id="caption-attachment-8918" class="wp-caption-text">Create new REST API Connection in SSIS (For JSON, XML or CSV Source)</p></div></li>
<li>Configure your Salesforce connection<img decoding="async" class="figureimage" title="SSIS Salesforce Connection Manager UI " src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/salesforce-connection/ssis-salesforce-connection-manager-ui.png" alt="SSIS Salesforce Connection Manager UI " /></li>
<li>Select or type filter. For example in this case you will type <pre class="crayon-plain-tag">$.factMap.T!T.rows[*]</pre></li>
<li>Uncheck Use Parents option (You can keep it but it will add many unwanted fields)<div class="su-note"  style="border-color:#e5e54c;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFFF66;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>NOTE:</strong> Please make sure that you&#8217;re configuring an API URL and not the HTML/Browser Page URL as both URLs will be different.Please make sure you replace instance name and report ID as per the below screenshot.<br />
<pre class="crayon-plain-tag">https://YOUR-ORG-INSTANCE.salesforce.com/services/data/v64.0/analytics/reports/YOUR-REPORT-ID</pre>
<strong>Example URLs </strong><br />
<pre class="crayon-plain-tag">https://na34.salesforce.com/services/data/v64.0/analytics/reports/00O61000001a97n

Using Salesforce Org Domain:
https://zappysys21.salesforce.com/services/data/v64.0/analytics/reports/00O61000001a97n

Using Personal Lighting/My Domain (works when [My Domain] feature enabled):
https://zappysys21.my.salesforce.com/services/data/v64.0/analytics/reports/00O61000001a97n

Using Direct Pod/Instance URL:
https://na34.salesforce.com/services/data/v64.0/analytics/reports/00O61000001a97n</pre>
</div></div>
<div id="attachment_10205" style="width: 794px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-read-salesforce-custom-reports.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10205" class="wp-image-10205 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-read-salesforce-custom-reports.png" alt="ssis-read-salesforce-custom-reports" width="784" height="652" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-read-salesforce-custom-reports.png 784w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-read-salesforce-custom-reports-300x249.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-read-salesforce-custom-reports-768x639.png 768w" sizes="(max-width: 784px) 100vw, 784px" /></a><p id="caption-attachment-10205" class="wp-caption-text">Configure &#8211; Read Salesforce Custom Reports Data</p></div></li>
<li>Now Go to Array Transform Tab
<ol>
<li>Select Transform Type : <pre class="crayon-plain-tag">Complex 2-dimensional array</pre></li>
<li>Column name filter: <pre class="crayon-plain-tag">$.reportMetadata.detailColumns[*]</pre></li>
<li>Row values filter: <pre class="crayon-plain-tag">$.dataCells[*].label</pre></li>
</ol>
</li>
<li>Here is how your Array Transform Tab configuration should look like
<div id="attachment_8921" style="width: 689px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/advanced-options-salesforce-custom-reports-rest-api-call.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8921" class="size-full wp-image-8921" src="https://zappysys.com/blog/wp-content/uploads/2018/07/advanced-options-salesforce-custom-reports-rest-api-call.png" alt="Configure - Advanced Array Transform (Read Salesforce Custom Reports Data in SSIS)" width="679" height="232" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/advanced-options-salesforce-custom-reports-rest-api-call.png 679w, https://zappysys.com/blog/wp-content/uploads/2018/07/advanced-options-salesforce-custom-reports-rest-api-call-300x103.png 300w" sizes="(max-width: 679px) 100vw, 679px" /></a><p id="caption-attachment-8921" class="wp-caption-text">Configure &#8211; Advanced Array Transform (Read Salesforce Custom Reports Data in SSIS)</p></div></li>
<li>Now Click OK to Save UI and attach your source to some target like OLEDB Destination and run your data flow to test.
<div id="attachment_8922" style="width: 548px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-extract-data-from-custom-salesforce-report.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8922" class="size-full wp-image-8922" src="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-extract-data-from-custom-salesforce-report.png" alt="Extract Data from Salesforce Custom Reports in SSIS - Load into Target like SQL Server, MySQL, PostgreSql, Oracle" width="538" height="602" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-extract-data-from-custom-salesforce-report.png 538w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-extract-data-from-custom-salesforce-report-268x300.png 268w" sizes="(max-width: 538px) 100vw, 538px" /></a><p id="caption-attachment-8922" class="wp-caption-text">Extract Data from Salesforce Custom Reports in SSIS &#8211; Load into Target like SQL Server, MySQL, PostgreSql, Oracle</p></div></li>
</ol>
<h2>Read Salesforce Custom Reports in ODBC Apps</h2>
<p>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?</p>
<div class="content_block" id="custom_post_widget-9166"><h2>Requirements</h2>
In order to access API data inside your App using ODBC Driver you will need to make sure following requirements are met.
<ol>
 	<li>Download and Install <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> (This includes XML / JSON / REST API and few other drivers for SQL Server and ODBC connectivity in tools like Excel, Power BI, SSRS)</li>
</ol></div>
<p>ZappySys Provides native <a href="https://zappysys.com/products/odbc-powerpack/salesforce-odbc-driver/" target="_blank" rel="noopener">Salesforce Driver</a> to read / write Salesforce Object&#8217;s data (Its part of <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ODBC PowerPack</a>). This driver can read/write standard objects (e.g. Accounts, Contacts) However <strong>reading from salesforce custom report</strong> is not supported by native driver. For this purpose you have to use <a href="https://zappysys.com/blog/how-to-call-salesforce-rest-api-via-odbc-driver/" target="_blank" rel="noopener">JSON / REST Driver using this approach</a>. With Generic REST / JSON API driver you can automate pretty much any Salesforce Operations. To get some advanced information on Report API you <a href="https://resources.docs.salesforce.com/rel1/doc/en-us/static/pdf/SF_Reports_and_Dashboards_Rest_API_web.pdf" target="_blank" rel="noopener">can refer this guide</a></p>
<p>So let&#8217;s get started.</p>
<ol>
<li>Follow <a href="https://zappysys.com/blog/how-to-call-salesforce-rest-api-via-odbc-driver/" target="_blank" rel="noopener">this blog post</a> to install JSON / REST Driver and configure Salesforce OAuth Connection.</li>
<li>Once you can read some sample data described in previous step we are ready to run advanced queries.</li>
<li>Go to Preview Tab and Run below Query to pull data from Custom Report<br />
<pre class="crayon-plain-tag">--change YOUR-INSTANCE and YOUR-REPORT-ID
SELECT * FROM $
WITH(
Src='https://YOUR-ORG-INSTANCE.salesforce.com/services/data/v64.0/analytics/reports/YOUR-REPORT-ID'
,Filter='$.factMap.T!T.rows[*]'
,ArrayTransformType='TransformComplexTwoDimensionalArray'
,ArrayTransColumnNameFilter='$.reportMetadata.detailColumns[*]'
,ArrayTransRowValueFilter='$.dataCells[*].label'
,RequestMethod='GET'
)</pre>
&nbsp;</li>
</ol>
<h2>Integrate Salesforce Data in ODBC Apps (e.g. Power BI, SSRS, Excel, Informatica, Access, C#&#8230;)</h2>
<div class="content_block" id="custom_post_widget-7051">ZappySys ODBC Drivers built using ODBC standard which is widely adopted by industry for a long time. Which mean the majority of BI Tools / Database Engines / ETL Tools already there will support native / 3rd party ODBC Drivers. Below is the small list of most popular tools / programming languages our Drivers support. If your tool / programming language doesn't appear in the below list, which means we have not documented use case but as long as your tool supports ODBC Standard, our drivers should work fine.

&nbsp;

<img loading="lazy" decoding="async" class="" src="//zappysys.com/images/odbc-powerpack/odbc-powerpack-integration.jpg" alt="ZappySys ODBC Drivers for REST API, JSON, XML - Integrate with Power BI, Tableau, QlikView, QlikSense, Informatica PowerCenter, Excel, SQL Server, SSIS, SSAS, SSRS, Visual Studio / WinForm / WCF, Python, C#, VB.net, PHP. PowerShell " width="750" height="372" />
<table style="valign: top;">
<tbody>
<tr>
<td>
<p style="text-align: center;"><strong>BI / Reporting Tools
Integration</strong></p>
</td>
<td style="text-align: center;"><strong>ETL Tools
Integration
</strong></td>
<td style="text-align: center;"><strong>Programming Languages</strong>
<strong>Integration</strong></td>
</tr>
<tr>
<td>
<ul>
 	<li><a href="https://zappysys.com/blog/howto-import-json-rest-api-power-bi/" target="_blank" rel="noopener">Microsoft Power BI</a></li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-tableau-read-json-soap-xml-csv/">Tableau</a></li>
 	<li><a href="https://zappysys.com/blog/read-rest-api-using-ssrs-reports-call-json-xml-web-service/" target="_blank" rel="noopener">SSRS (SQL Reporting Services)</a></li>
 	<li><a href="https://zappysys.com/blog/qlik-rest-connector-examples-read-json-xml-api/" target="_blank" rel="noopener">QlikView /Qlik Sense</a></li>
 	<li><a href="https://zappysys.com/blog/call-rest-api-in-microstrategy-json-soap-xml/" target="_blank" rel="noopener">MicroStrategy</a></li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-google-sheet-call-appscript-load-json-soap-xml-csv/" target="_blank" rel="noopener">Google Sheet</a></li>
 	<li><a href="https://zappysys.com/blog/import-json-excel-load-file-rest-api/" target="_blank" rel="noopener">Microsoft Excel</a></li>
 	<li><a href="https://zappysys.com/api/integration-hub/rest-api-connector/access?context=connector" target="_blank" rel="noopener">Microsoft Access</a></li>
 	<li>Oracle OBIEE</li>
 	<li>Many more (not in this list).....</li>
</ul>
</td>
<td>
<ul>
 	<li><a href="https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/" target="_blank" rel="noopener">Informatica PowerCenter</a> (Windows)</li>
 	<li>Informatica Cloud</li>
 	<li>SSIS (SQL Integration Services)</li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-json-sql-server/" target="_blank" rel="noopener">SQL Server</a></li>
 	<li><a href="https://zappysys.com/blog/read-write-rest-api-data-in-talend-json-xml-soap/" target="_blank" rel="noopener">Talend Data Studio</a></li>
 	<li><a href="https://zappysys.com/blog/pentaho-read-rest-api-in-pentaho/" target="_blank" rel="noopener">Pentaho Kettle</a></li>
 	<li>Oracle OBIEE</li>
 	<li>Many more (not in this list).....</li>
</ul>
</td>
<td>
<ul>
 	<li>Visual Studio</li>
 	<li><a href="https://zappysys.com/blog/calling-rest-api-in-c/" target="_blank" rel="noopener">C#</a></li>
 	<li>C++</li>
 	<li><a href="https://zappysys.com/blog/connect-java-to-rest-api-json-soap-xml/" target="_blank" rel="noopener">JAVA</a></li>
 	<li><a href="https://zappysys.com/blog/set-rest-python-client/" target="_blank" rel="noopener">Python</a></li>
 	<li>PHP</li>
 	<li><a href="https://zappysys.com/blog/call-rest-api-powershell-script-export-json-csv/" target="_blank" rel="noopener">PowerShell</a></li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-json-sql-server/" target="_blank" rel="noopener">T-SQL (Using Linked Server)</a></li>
</ul>
</td>
</tr>
</tbody>
</table>
&nbsp;</div>
<h2>Conclusion</h2>
<p>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 <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a> or if you need to integration in other apps then <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">get ODBC PowerPack here</a></p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/read-salesforce-custom-reports-ssis-odbc/">Read from Salesforce Custom Reports in SSIS / ODBC</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to call Salesforce REST API via ODBC driver</title>
		<link>https://zappysys.com/blog/how-to-call-salesforce-rest-api-via-odbc-driver/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 29 Jun 2018 12:59:37 +0000</pubDate>
				<category><![CDATA[JSON File / REST API Driver]]></category>
		<category><![CDATA[ODBC PowerPack]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[odbc]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[salesforce]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=4241</guid>

					<description><![CDATA[<p>Introduction Salesforce is a popular CRM tool that lets you manage your sales, contacts, products, and other useful things. In this tutorial, you will learn how to call Salesforce REST API via ODBC driver using ZappySys JSON Driver. You can also use  ZappySys Salesforce Driver for salesforce data read / write but this article covers more more [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/how-to-call-salesforce-rest-api-via-odbc-driver/">How to call Salesforce REST API via ODBC driver</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><span id="Prerequisites"><img loading="lazy" decoding="async" class="size-full wp-image-1764 alignleft" src="//zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180.png" alt="" width="180" height="180" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180.png 180w, https://zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180-150x150.png 150w" sizes="(max-width: 180px) 100vw, 180px" />Introduction</span></h2>
<p><a href="https://www.salesforce.com/" target="_blank" rel="noopener">Salesforce</a> is a popular CRM tool that lets you manage your sales, contacts, products, and other useful things. In this tutorial, you will learn how to call Salesforce REST API via ODBC driver using <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys JSON Driver</a>. You can also use  <a href="https://zappysys.com/products/odbc-powerpack/salesforce-odbc-driver/" target="_blank" rel="noopener">ZappySys Salesforce Driver</a> for salesforce data read / write but this article covers more more generic API calling usecase.</p>
<p>You will find out how to register a <em>Connected App</em> in Salesforce, set OAuth authentication and use it for data retrieval. We will cover a topic of how to load leads from Salesforce and use them virtually in any application which supports ODBC. We will not stop with that and touch a possibility of calling any method of any REST API-based Salesforce API; be it insert or simple retrieval.</p>
<h2><span id="Prerequisites">Prerequisites</span></h2>
<p>Make sure you meet these requirements:</p>
<ol>
<li><a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> installed.</li>
<li>Have a registered, working Salesforce account.</li>
</ol>
<h2></h2>
<h2><span id="Step-by-Step_Get_data_from_HubSpot_API_into_SQL_Server_database"><span id="Step-By-StepGet_data_from_HubSpot_REST_API"><span id="Step-By-Step_8211_Call_Amazon_MWS_API_using_SSIS">Register Salesforce App (for OAuth) </span></span></span></h2>
<div class="content_block" id="custom_post_widget-9476">In this section, we will discuss how to register OAuth App to call Salesforce API using Client ID / Secret rather than using your User Id / Password.

Once you follow these steps below to register your Salesforce App (OAuth App), at the end you will get a Client ID (sometimes referred to as App Id) and Client Secret (or App Secret). These two pieces can be used later on to call Salesforce API using OAuth.

So let's get started.
<h3>Register Salesforce App (OAuth)</h3>
<ol>
 	<li>Login into your account and go to <strong><em>Setup</em> </strong>as shown below (click on gear icon at the top right corner):
<img loading="lazy" decoding="async" src="https://zappysys.zendesk.com/attachments/token/7D9Rx9qHJswkt28sC5vTggrNT/?name=inline-1178316509.png" alt="Accessing Salesforce Setup to create an OAuth App" width="342" height="233" data-original-height="233" data-original-width="342" /></li>
 	<li>Then in the search bar input "app" and open <strong><em>App Manager</em></strong>:
<img loading="lazy" decoding="async" src="https://zappysys.zendesk.com/attachments/token/DTjFQpyDw4NViKdJyhyFkO1ng/?name=inline1698967483.png" alt="Searching Salesforce App Manager to create an OAuth App" width="689" height="364" data-original-height="364" data-original-width="689" /></li>
 	<li>Then click <strong><em>New Connected App</em></strong> to create a new OAuth App:
<strong>NOTE:</strong> In some version, it may say <strong><strong>New External Client App
</strong></strong>
<p data-start="1271" data-end="1309">Look for one of the following buttons:</p>

<ul data-start="1310" data-end="1395">
 	<li data-start="1310" data-end="1348">
<p data-start="1312" data-end="1348"><strong data-start="1312" data-end="1333">New Connected App</strong> (Classic name)</p>
</li>
 	<li data-start="1349" data-end="1395">
<p data-start="1351" data-end="1395"><strong data-start="1351" data-end="1378">New External Client App</strong> (Lightning name)</p>
</li>
</ul>
<img loading="lazy" decoding="async" src="https://zappysys.zendesk.com/attachments/token/eD6OrA9TqfRuM5N41Vqd7nrvb/?name=inline684283902.png" alt="Creating a Salesforce App to get data via ODBC driver" width="867" height="327" data-original-height="327" data-original-width="867" /></li>
 	<li>Give your App a name and:
- Enable OAuth Settings
- Set callback URL to following two URLs (one in each line)
<strong><em>https://login.salesforce.com/services/oauth2/success
</em></strong><em><strong>https://zappysys.com/oauth</strong></em>
- Add an OAuth scope you want or simply add "<strong><em>Full access</em></strong>".
- Add "<strong><em>Perform requests on your behalf at any time (offline_token)</em></strong>" scope to get a refresh token so that you don't have to re-authenticate each time requesting an access token:<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/create-salesforce-connected-oauth-app-for-odbc-datasource.png"><img loading="lazy" decoding="async" class="wp-image-4267 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/create-salesforce-connected-oauth-app-for-odbc-datasource.png" alt="Configuring Salesforce App OAuth settings to get data via ODBC driver" width="1041" height="700" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/create-salesforce-connected-oauth-app-for-odbc-datasource.png 1041w, https://zappysys.com/blog/wp-content/uploads/2018/06/create-salesforce-connected-oauth-app-for-odbc-datasource-300x202.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/create-salesforce-connected-oauth-app-for-odbc-datasource-768x516.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/06/create-salesforce-connected-oauth-app-for-odbc-datasource-1024x689.png 1024w, https://zappysys.com/blog/wp-content/uploads/2018/06/create-salesforce-connected-oauth-app-for-odbc-datasource-272x182.png 272w" sizes="(max-width: 1041px) 100vw, 1041px" /></a>

<span style="text-decoration: underline; color: #800000;"><strong>IMPORTANT:</strong></span> You can use "<strong>Access and manage your data (api)</strong>" if you do not like to grant full permission to this app but make sure you request same permission from the caller app too  (Example on ZappySys Salesforce Connection UI -&gt; Advanced Tab -&gt; Set scope as "<strong>api offline_access</strong>" rather than "<strong>full offline_access</strong>"</li>
 	<li>Click "Save".</li>
</ol>
<h3>Get Client Id and Client Secret for Salesforce Connected App</h3>
Once the App is created, we need to find out the App Id / Secret so we can use it for API calls.
<ol>
 	<li>Go to App Manager</li>
 	<li>Find out the recently created App and click View (click on the small arrow to the right)
<a href="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-view-edit-oauth-app-settings.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-9477" src="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-view-edit-oauth-app-settings.png" alt="" width="1029" height="413" srcset="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-view-edit-oauth-app-settings.png 1029w, https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-view-edit-oauth-app-settings-300x120.png 300w, https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-view-edit-oauth-app-settings-768x308.png 768w, https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-view-edit-oauth-app-settings-1024x411.png 1024w" sizes="(max-width: 1029px) 100vw, 1029px" /></a></li>
 	<li>Once App page is loaded you can Copy <strong>Consumer Key</strong> and <strong>Consumer Secret</strong> (click on reveal to see). Also copy anyone Call back URL (We will need this for OAuth Connection &gt; Advanced Tab &gt; Call Back URL or Redirect URL property depending on which ZappySys Product / Driver you are using)
<a href="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-oauth-app-clientid-secret-callbackurl.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-9478" src="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-oauth-app-clientid-secret-callbackurl.png" alt="" width="974" height="554" srcset="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-oauth-app-clientid-secret-callbackurl.png 974w, https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-oauth-app-clientid-secret-callbackurl-300x171.png 300w, https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-oauth-app-clientid-secret-callbackurl-768x437.png 768w" sizes="(max-width: 974px) 100vw, 974px" /></a></li>
 	<li>That's it, you can now use these 3 pieces to ZappySys <strong>OAuth connection UI</strong> or on <strong>Salesforce Connection UI</strong> (new version with OAuth support). The above screenshot shows where to enter these 3 pieces in the New Salesforce Connection. For the OAuth Connection, the redirect URL goes to the Advanced Tab &gt; Callback URL textbox.</li>
</ol>
<h3>Get Client Id and Secret for Salesforce External Client App</h3>
If you created a new App by clicking on the <strong>New External Client App</strong> button, then your App may not be visible in the App Manager Screen. In that case, find it below way.

[caption id="attachment_11637" align="alignnone" width="1222"]<a href="https://zappysys.com/blog/wp-content/uploads/2021/12/obtain-salesforce-oauth-clientid-secret.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-11637" src="https://zappysys.com/blog/wp-content/uploads/2021/12/obtain-salesforce-oauth-clientid-secret.jpg" alt="" width="1222" height="733" srcset="https://zappysys.com/blog/wp-content/uploads/2021/12/obtain-salesforce-oauth-clientid-secret.jpg 1222w, https://zappysys.com/blog/wp-content/uploads/2021/12/obtain-salesforce-oauth-clientid-secret-300x180.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2021/12/obtain-salesforce-oauth-clientid-secret-1024x614.jpg 1024w, https://zappysys.com/blog/wp-content/uploads/2021/12/obtain-salesforce-oauth-clientid-secret-768x461.jpg 768w" sizes="(max-width: 1222px) 100vw, 1222px" /></a> Get Client Id, Client Secret - For New External Client App[/caption]
<h3>Enable Client Credentials Grant (Non-Interactive Run-As)</h3>
If you like to enable Non-Interactive mode, just like UserId / Password Authentication, but without actually passing a real UserId or Password on the Connection UI, then you can enable Client Credentials Flow as below.

<strong>NOTE:</strong> Only the New version of ZappySys Salesforce Connection supports Client Credentials Grant. <span style="text-decoration: underline;"><strong>Version released after Nov 1, 2025 supports this grant type</strong></span>.

[caption id="attachment_11639" align="alignnone" width="419"]<a href="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-client-credentials-grant-runas.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-11639" src="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-client-credentials-grant-runas.jpg" alt="" width="419" height="480" srcset="https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-client-credentials-grant-runas.jpg 419w, https://zappysys.com/blog/wp-content/uploads/2021/12/salesforce-client-credentials-grant-runas-262x300.jpg 262w" sizes="(max-width: 419px) 100vw, 419px" /></a> Enable Salesforce Client Credentials Grant (Run As)[/caption]
<h3>(OPTIONAL) Configure Salesforce OAuth refresh token validity</h3>
By default, Salesforce Refresh Token doesn't expire once you generate. If you want to change the default behavior, follow these steps.
<ol>
 	<li>Go to "<strong>Manage Connected Apps</strong>" menu item and press on your App name:<img loading="lazy" decoding="async" class="wp-image-4298 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-oauth-app-policy-management-2.png" alt="Finding Salesforce App to configure its policies" width="660" height="410" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-oauth-app-policy-management-2.png 660w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-oauth-app-policy-management-2-300x186.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-oauth-app-policy-management-2-436x272.png 436w" sizes="(max-width: 660px) 100vw, 660px" /></li>
 	<li>Click "Edit Policies" to configure refresh token validity:
<img loading="lazy" decoding="async" class="wp-image-4271 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/edit-salesforce-connected-app-policies.png" alt="Editing Salesforce App OAuth refresh token issuing policy" width="680" height="391" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/edit-salesforce-connected-app-policies.png 680w, https://zappysys.com/blog/wp-content/uploads/2018/06/edit-salesforce-connected-app-policies-300x173.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></li>
 	<li>Set "<strong>All users may self-authorize</strong>" and "<strong>Refresh token is valid until revoked</strong>" options:<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-app-odbc-oauth-refresh-token-validity-1.png"><img loading="lazy" decoding="async" class="wp-image-4273 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-app-odbc-oauth-refresh-token-validity-1.png" alt="Making Salesforce App OAuth refresh token to never expire" width="870" height="498" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-app-odbc-oauth-refresh-token-validity-1.png 870w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-app-odbc-oauth-refresh-token-validity-1-300x172.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-app-odbc-oauth-refresh-token-validity-1-768x440.png 768w" sizes="(max-width: 870px) 100vw, 870px" /></a></li>
 	<li>Click "Save".</li>
</ol>
<h3></h3></div>
<h2><span id="Step-by-Step_Get_data_from_HubSpot_API_into_SQL_Server_database"><span id="Step-By-StepGet_data_from_HubSpot_REST_API"><span id="Step-By-Step_8211_Call_Amazon_MWS_API_using_SSIS">Calling Salesforce REST API with ODBC driver</span></span></span></h2>
<p>To call Salesforce API, you need to have a Salesforce Connected App with enabled OAuth authentication. It will be used by ODBC Data Source, which we will create in the subsequent step. Then we will configure ODBC Data Source with Salesforce REST API URL and other parameters to access the leads.</p>
<h3>How to Find Your Salesforce Instance ID</h3>
<p>To call Salesforce API you have to supply Salesforce InstanceID in API Url. If you are not sure what is your Salesforce Instance ID then its very simple. Just look at your Salesforce URL after you login in Browser. First part in Domain would be your InstanceID (e.g. <strong>na34</strong> if your URL looks like <strong>https://<span style="color: #3366ff;">na34</span>.salesforce.com/xxxxxxxxx</strong> ). You can also click <strong>Setup</strong> &gt; Under <strong>Administrator</strong> &gt; Click <strong>Company Profile</strong> &gt; <strong>Company Information</strong> &gt; Look for <strong>Instance</strong></p>
<div id="attachment_5237" style="width: 1006px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/how-to-find-salesforce-instance-id.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5237" class="size-full wp-image-5237" src="https://zappysys.com/blog/wp-content/uploads/2018/06/how-to-find-salesforce-instance-id.png" alt="How to find your Salesforce Instance ID" width="996" height="364" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/how-to-find-salesforce-instance-id.png 996w, https://zappysys.com/blog/wp-content/uploads/2018/06/how-to-find-salesforce-instance-id-300x110.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/how-to-find-salesforce-instance-id-768x281.png 768w" sizes="(max-width: 996px) 100vw, 996px" /></a><p id="caption-attachment-5237" class="wp-caption-text">How to find your Salesforce Instance ID</p></div>
<p>&nbsp;</p>
<h3>Create an ODBC Data Source using ZappySys JSON Driver</h3>
<ol>
<li>Open ODBC Data Source Administrator
<div id="attachment_4232" style="width: 403px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4232" class="wp-image-4232 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/open-ODBC-Data-souce-administrator.png" alt="Finding Windows ODBC Data Source Manager" width="393" height="531" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/open-ODBC-Data-souce-administrator.png 393w, https://zappysys.com/blog/wp-content/uploads/2018/06/open-ODBC-Data-souce-administrator-222x300.png 222w" sizes="(max-width: 393px) 100vw, 393px" /><p id="caption-attachment-4232" class="wp-caption-text">Finding Windows ODBC Data Source Manager</p></div></li>
<li>Add a new ODBC Data Source based on <em>ZappySys JSON Driver</em>:
<div id="attachment_4268" style="width: 604px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/create-odbc-datasource-using-zappysys-json-driver.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4268" class="wp-image-4268 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/create-odbc-datasource-using-zappysys-json-driver.png" alt="Adding a new ODBC Data Source based on ZappySys JSON Driver" width="594" height="550" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/create-odbc-datasource-using-zappysys-json-driver.png 594w, https://zappysys.com/blog/wp-content/uploads/2018/06/create-odbc-datasource-using-zappysys-json-driver-300x278.png 300w" sizes="(max-width: 594px) 100vw, 594px" /></a><p id="caption-attachment-4268" class="wp-caption-text">Adding a new ODBC Data Source based on ZappySys JSON Driver</p></div></li>
</ol>
<h3>Configure the Data Source</h3>
<ol>
<li>Start configuring Data Source:<br />
&#8211; Enter URL:<br />
<em>https://<strong>&lt;your_instance&gt;</strong>.salesforce.com/services/data/v20.0/query/?q=SELECT+id,name,email+FROM+Lead<br />
</em>&#8211; Select &#8220;<em>OAuth</em>&#8221; for Connection Type.<br />
&#8211; You can set <em>HTTP Request Method</em> to &#8220;GET&#8221;.<br />
&#8211; Continue by clicking &#8220;Click to Configure&#8221;:</p>
<div id="attachment_4274" style="width: 670px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-odbc-zappysys-json-driver-configuration.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4274" class="wp-image-4274 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-odbc-zappysys-json-driver-configuration-e1530705704131.png" alt="Configuring ODBC Data Source to get leads from Salesforce" width="660" height="702" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-odbc-zappysys-json-driver-configuration-e1530705704131.png 660w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-odbc-zappysys-json-driver-configuration-e1530705704131-282x300.png 282w" sizes="(max-width: 660px) 100vw, 660px" /></a><p id="caption-attachment-4274" class="wp-caption-text">Configuring ODBC Data Source to get leads from Salesforce</p></div></li>
<li>Once a window appears, go to <em>Salesforce App Manager</em> and view your App settings, so that you can use them for Data Source configuration:
<div id="attachment_4275" style="width: 868px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-oauth-app-view-settings-for-odbc-configuration.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4275" class="wp-image-4275 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-oauth-app-view-settings-for-odbc-configuration.png" alt="Opening Salesforce App OAuth settings to be used in ODBC Data Source" width="858" height="289" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-oauth-app-view-settings-for-odbc-configuration.png 858w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-oauth-app-view-settings-for-odbc-configuration-300x101.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-oauth-app-view-settings-for-odbc-configuration-768x259.png 768w" sizes="(max-width: 858px) 100vw, 858px" /></a><p id="caption-attachment-4275" class="wp-caption-text">Opening Salesforce App OAuth settings to be used in ODBC Data Source</p></div></li>
<li>Then go back to ODBC configuration, select tab <em>Advanced</em> and set <em>Callback/Return Url</em> to &#8220;<em>https://login.salesforce.com/services/oauth2/success</em>&#8220;:
<div id="attachment_4278" style="width: 596px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-odbc-data-source-oauth-callback-configuration.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4278" class="wp-image-4278 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-odbc-data-source-oauth-callback-configuration.png" alt="Configuring Callback Url in ODBC Data Source OAuth options" width="586" height="493" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-odbc-data-source-oauth-callback-configuration.png 586w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-odbc-data-source-oauth-callback-configuration-300x252.png 300w" sizes="(max-width: 586px) 100vw, 586px" /></a><p id="caption-attachment-4278" class="wp-caption-text">Configuring Callback Url in ODBC Data Source OAuth options</p></div></li>
<li>Then go back to tab <em>General</em> and configure rest options using Salesforce App settings:<br />
&#8211; From Salesforce App settings copy <strong><em>Consumer Key</em></strong> to <strong><em>Client Id</em></strong><br />
&#8211; Then copy <em>Consumer Secret</em> to <em>Client Secret<br />
&#8211; </em>Set <strong>Authorization Url</strong> to &#8220;<em>https://login.salesforce.com/services/oauth2/authorize&#8221;</em><br />
&#8211; Set <strong>Access Token Url</strong> to &#8220;<em>https://login.salesforce.com/services/oauth2/token&#8221;<br />
</em>&#8211; Set <strong>Scopes</strong> to below (For complete list of possible scopes <a href="https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_tokens_scopes.htm&amp;type=5" target="_blank" rel="noopener">refer this link</a> &#8211; scroll to OAuth Scopes section)<br />
<pre class="crayon-plain-tag">full
offline_access</pre>
&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_4276" style="width: 887px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-oauth-app-configuration-for-odbc.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4276" class="wp-image-4276 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-oauth-app-configuration-for-odbc.png" alt="Configuring ODBC Data Source with Salesforce App OAuth settings" width="877" height="591" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-oauth-app-configuration-for-odbc.png 877w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-oauth-app-configuration-for-odbc-300x202.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-oauth-app-configuration-for-odbc-768x518.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-oauth-app-configuration-for-odbc-272x182.png 272w" sizes="(max-width: 877px) 100vw, 877px" /></a><p id="caption-attachment-4276" class="wp-caption-text">Configuring ODBC Data Source with Salesforce App OAuth settings</p></div>
<div class="su-note"  style="border-color:#e5dd9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF7B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><a href="https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_oauth_endpoints.htm" target="_blank" rel="noopener">On a sandbox organization you need to use &#8220;test.salesforce.com&#8221; domain</a></div></div></li>
<li>Click &#8220;Generate Token&#8221; button to generate the tokens. Once Salesforce login window appears, enter your Salesforce credentials and log in.</li>
<li>Click &#8220;OK&#8221; to close the window.</li>
</ol>
<h3>Load data from Salesforce using ODBC Data Source</h3>
<p>We are ready to retrieve the data. So just open &#8220;Preview&#8221; tab in Data Source configuration window and hit &#8220;Preview Data&#8221; button:</p>
<div id="attachment_4282" style="width: 780px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-data-retrieval-preview-using-odbc-powerpack-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4282" class="wp-image-4282 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-data-retrieval-preview-using-odbc-powerpack-1.png" alt="Previewing Salesforce data in ODBC Data Source" width="770" height="645" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-data-retrieval-preview-using-odbc-powerpack-1.png 770w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-data-retrieval-preview-using-odbc-powerpack-1-300x251.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-data-retrieval-preview-using-odbc-powerpack-1-768x643.png 768w" sizes="(max-width: 770px) 100vw, 770px" /></a><p id="caption-attachment-4282" class="wp-caption-text">Previewing Salesforce data in ODBC Data Source</p></div>
<p>As you see we have no actual lead names because they are present in column &#8220;records&#8221;. So replace &#8220;$&#8221; with column name &#8220;records&#8221; in &#8220;SELECT * FROM $&#8221; query to select actual lead records from JSON property &#8220;records&#8221; (which denotes a table in ODBC):</p>
<div id="attachment_4283" style="width: 780px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-data-retrieval-preview-2-using-odbc-powerpack-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4283" class="wp-image-4283 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-data-retrieval-preview-2-using-odbc-powerpack-1.png" alt="Changing table name in ODBC query to get the actual leads" width="770" height="645" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-data-retrieval-preview-2-using-odbc-powerpack-1.png 770w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-data-retrieval-preview-2-using-odbc-powerpack-1-300x251.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-data-retrieval-preview-2-using-odbc-powerpack-1-768x643.png 768w" sizes="(max-width: 770px) 100vw, 770px" /></a><p id="caption-attachment-4283" class="wp-caption-text">Changing table name in ODBC query to get the actual leads</p></div>
<p>Then click &#8220;Preview Data&#8221; again to get the leads:</p>
<div id="attachment_4284" style="width: 697px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-data-retrieval-preview-final-using-odbc-powerpack.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4284" class="wp-image-4284 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-data-retrieval-preview-final-using-odbc-powerpack.png" alt="Successfully retrieved Salesforce leads using Salesforce REST API and ODBC Driver" width="687" height="645" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-data-retrieval-preview-final-using-odbc-powerpack.png 687w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-data-retrieval-preview-final-using-odbc-powerpack-300x282.png 300w" sizes="(max-width: 687px) 100vw, 687px" /></a><p id="caption-attachment-4284" class="wp-caption-text">Successfully retrieved Salesforce leads using Salesforce REST API and ODBC Driver</p></div>
<p>You are ready to use ODBC Data Source in an application!</p>
<h2>Pagination in Salesforce REST API</h2>
<p>Even you are ready to use the configured ODBC Data Source in an external application, the solution is not yet fully implemented. If you have too many leads or records than Salesforce can give you in one HTTP response you won&#8217;t get all the records. Thus you will need to use pagination. For that, go to &#8220;Pagination&#8221; tab and configure it like this:</p>
<div id="attachment_4286" style="width: 802px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-get-data-pagination-configuration-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4286" class="wp-image-4286 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-get-data-pagination-configuration-1.png" alt="Configuring ODBC Data Source to paginate through Salesforce results" width="792" height="789" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-get-data-pagination-configuration-1.png 792w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-get-data-pagination-configuration-1-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-get-data-pagination-configuration-1-300x300.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/salesforce-rest-api-get-data-pagination-configuration-1-768x765.png 768w" sizes="(max-width: 792px) 100vw, 792px" /></a><p id="caption-attachment-4286" class="wp-caption-text">Configuring ODBC Data Source to paginate through Salesforce results</p></div>
<p>If you need something more sophisticated then check <a href="https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/" target="_blank" rel="noopener">the article</a> about pagination (initially it was written for SSIS PowerPack but UI options and concepts apply to ODBC Driver too).</p>
<h2>Using ODBC query in an application</h2>
<p>Let&#8217;s say you want to access Salesforce Accounts instead of Leads. It seems the most logical thing to do is create another ODBC Data Source and change the URL. However, you can use the same ODBC Data Source and override its properties with ODBC query. Just copy the generated ODBC query, leave the things you want to override and use it in your application:</p><pre class="crayon-plain-tag">SELECT * FROM records
WITH(
Src='https://***yourinstance****.salesforce.com/services/data/v44.0/query/?q=SELECT+Id,name,Email+FROM+Lead'
)</pre><p>
In the example above, we are overriding &#8220;Url&#8221; property and accessing Accounts.</p>
<p>Check an article <a href="https://zappysys.com/blog/import-json-excel-load-file-rest-api/" target="_blank" rel="noopener">how to import data into Excel using ODBC Data Source with ZappySys</a> to see how to use ODBC Data Source in your application. For more examples, check <a href="https://zappysys.com/blog/category/odbc-powerpack/" target="_blank" rel="noopener">ODBC PowerPack blog category</a>.</p>
<h2>Field names for SELECT Query</h2>
<p>One known issue in Salesforce REST API is you cannot use * to fetch all columns in SOQL. So you must specify column names manually. If you like to know all possible column names for given Table name then use below query.</p>
<p>https://na34.salesforce.com/services/data/v20.0/sobjects/Account/describe/</p><pre class="crayon-plain-tag">SELECT label,name,length,type,nillable,unique FROM $
WITH(
	 Src='https://**YOUR-INSTANCE**.salesforce.com/services/data/v44.0/sobjects/**YOUR-TABLE**/describe/'
	,Filter='$.fields[*]'
)</pre><p>
For example to get fields for Account table in ns34 instance you can use below URL</p>
<p><strong>https://<span style="color: #3366ff;">na34</span>.salesforce.com/services/data/v44.0/sobjects/<span style="color: #3366ff;">Account</span>/describe/</strong></p>
<p>&nbsp;</p>
<h2>Error Handling in Salesforce REST API</h2>
<div class="content_block" id="custom_post_widget-3894">Sometimes errors occur... they just do and there is nothing you can do! Or can you? Actually, in ODBC PowerPack you can handle them in two ways.
<h3>METHOD 1 - Using Error Handling Options</h3>
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-3949" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-error-handling-1.png" alt="" width="668" height="702" />
<h4>When to use?</h4>
You may want to use them when your source is a resource located on the Internet; e.g. a file on a website, a file on an FTP server or just a plain API HTTP response. By default, when a remote server returns an error, data retrieval is stopped, an error is raised and no data is given back to you. This might not be always desirable.
<h4>Scenario 1</h4>
Imagine a scenario, that there is a web server which each day at 12 AM releases a new JSON file with that day's date as filename, e.g. <span style="text-decoration: underline;"><em>http://www.some-server.com/data/2018-06-20.json</em></span>. And, of course, you want to download it and use it daily in your Power BI report. But you have a problem: Power BI report data sources are refreshed each hour and you may get <a href="https://en.wikipedia.org/wiki/HTTP_404" target="_blank" rel="noopener">HTTP 404 status code</a> (no file was found) when a file is not released yet. Which consequentially means other data sources won't be updated as well and you will see old and cached data on the report. That's where you could use <strong><span class="lang:default highlight:0 decode:true crayon-inline">Continue on any error</span></strong> or <strong><span class="lang:default highlight:0 decode:true crayon-inline">Continue when Url is invalid or missing (404 Errors)</span></strong> to avoid an error being raised and let other data sources to be updated.
<h4>Scenario 2</h4>
Another scenario is when you expect a web server to raise some kind of HTTP error when accessing a URL. You don't want ODBC Data Source to raise an error but instead, you want to get response data. That's where you can use <strong><span class="lang:default highlight:0 decode:true crayon-inline">Continue on any error</span></strong> or alike together with  <strong><span class="lang:default highlight:0 decode:true crayon-inline">Get response data on error</span></strong> to continue on an error and get the data:

<img loading="lazy" decoding="async" class="alignnone wp-image-3961 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-get-response-data-on-error.png" alt="" width="547" height="235" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-get-response-data-on-error.png 547w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-get-response-data-on-error-300x129.png 300w" sizes="(max-width: 547px) 100vw, 547px" />
<h3>METHOD 2 - Using Connection [Retry Settings]</h3>
Another scenario you may run into is a buggy web server. You ask it to give you some file or data and it, like a snotty kid, just doesn't give it to you! You have to ask twice or thrice before it does its job. If that's the case, you have to retry HTTP requests using <em>Connection</em>:

<img loading="lazy" decoding="async" class="alignnone wp-image-3963 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-error-handling-3.png" alt="" width="671" height="572" /></div>
<h2>Using various Salesforce APIs</h2>
<p>We used <a href="https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_search.htm" target="_blank" rel="noopener">Salesforce REST API Search method</a> to access the leads. The <a href="https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm" target="_blank" rel="noopener">SOQL query</a> we used looks identical to SQL in our case, so you can use other <a href="https://developer.salesforce.com/docs/atlas.en-us.sfFieldRef.meta/sfFieldRef/salesforce_field_reference.htm" target="_blank" rel="noopener">table names</a> to access their data too. Or you can even use <a href="https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm" target="_blank" rel="noopener">a more complex SOQL query</a> in the same <em>Search</em> method. The <em>Search</em> method is not the only one that is available in Salesforce REST API, <a href="https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_list.htm" target="_blank" rel="noopener">check other REST API methods</a> too (you can even use the ones that insert/update the data).</p>
<p>In addition to <em>Salesforce REST API,</em> Salesforce has many more APIs, such as <em>Salesforce Marketing Cloud API</em>,<em> Salesforce CPQ API</em>,<em> Salesforce IoT REST API,</em> <a href="https://developer.salesforce.com/docs/api-explorer" target="_blank" rel="noopener">and others</a>. You can use virtually any of them with <em>ZappySys JSON Driver</em> or <em>ZappySys XML Driver</em> since the drivers are highly configurable (you can call any API method with any HTTP method &#8211; be it POST, PUT or any other).</p>
<h2>Reading data from Salesforce Custom Reports</h2>
<p>So far we talked basic query to read data using SOQL / Standard Tables. But what if you have cuCheck <a href="https://zappysys.com/blog/read-salesforce-custom-reports-ssis-odbc/" target="_blank" rel="noopener">this article</a> to findout some techniques to read data from salesforce Custom Reports.</p>
<h2>Resources</h2>
<ul>
<li><a href="https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_search.htm" target="_blank" rel="noopener">Salesforce REST API Search method documentation</a></li>
<li><a href="https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_list.htm" target="_blank" rel="noopener">Salesforce REST API methods</a></li>
<li><a href="https://developer.salesforce.com/docs/atlas.en-us.sfFieldRef.meta/sfFieldRef/salesforce_field_reference.htm" target="_blank" rel="noopener">Salesforce Table list</a></li>
<li><a href="https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm" target="_blank" rel="noopener">Salesforce SOQL Documentation</a></li>
<li><a href="https://developer.salesforce.com/docs/api-explorer" target="_blank" rel="noopener">Salesforce API Explorer</a></li>
</ul>
<h2>Conclusion</h2>
<p>We covered a whole process of how to access Salesforce data: starting from creating a Salesforce application, continuing by authenticating using OAuth and finishing by using an ODBC query in a target application. You learned how to retrieve the fields of Salesforce leads and paginate through the results. Now you are on a good path of using other API methods and even other Salesforce APIs 😉</p>
<p>The post <a href="https://zappysys.com/blog/how-to-call-salesforce-rest-api-via-odbc-driver/">How to call Salesforce REST API via ODBC driver</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to read Salesforce data in SSIS &#8211; Export to SQL Server</title>
		<link>https://zappysys.com/blog/export-data-from-salesforce-to-sql-server-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Mon, 04 Sep 2017 14:09:18 +0000</pubDate>
				<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS Components]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[SSIS Salesforce Source]]></category>
		<category><![CDATA[salesforce]]></category>
		<category><![CDATA[salesforce api]]></category>
		<category><![CDATA[salesforce soap api]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[ssis salesforce connection]]></category>
		<category><![CDATA[ssis salesforce source]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=1760</guid>

					<description><![CDATA[<p>Introduction In this tutorial, you will learn how to read data from Salesforce to SQL Server using SSIS Salesforce Source. In this article, we will extract Salesforce contacts and import them into a SQL Server database table. Also, you will learn how to do basic filtering on the contacts and get only a subset of them. Finally, [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/export-data-from-salesforce-to-sql-server-using-ssis/">How to read Salesforce data in SSIS &#8211; Export to SQL Server</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="//zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180.png"><img loading="lazy" decoding="async" class="size-full wp-image-1764 alignleft" src="//zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180.png" alt="" width="180" height="180" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180.png 180w, https://zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180-150x150.png 150w" sizes="(max-width: 180px) 100vw, 180px" /></a></p>
<p>In this tutorial, you will learn how to read data from Salesforce to SQL Server using <a href="//zappysys.com/products/ssis-powerpack/ssis-salesforce-source-connector/"><acronym title="SQL Server Integration Services">SSIS</acronym> Salesforce Source</a>.</p>
<p>In this article, we will extract Salesforce contacts and import them into a SQL Server database table. Also, you will learn how to do basic filtering on the contacts and get only a subset of them. Finally, we will briefly touch some additional advanced options of Salesforce Source component. Namely, you will learn how to convert datetime columns to different formats.</p>
<p>To achieve our goal we will use Salesforce Source SSIS component. Under the hood, it uses <a href="https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_quickstart_intro.htm" target="_blank" rel="noopener">Salesforce API</a> to make calls to, but you don&#8217;t have to be concerned about that:</p>
<div class="su-table su-table-alternate">
<table width="276">
<tbody>
<tr class="su-even" style="line-height: 0px">
<td width="50px"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/ssis-salesforce-source.png"><img loading="lazy" decoding="async" class="alignnone wp-image-1775" src="//zappysys.com/blog/wp-content/uploads/2017/09/ssis-salesforce-source.png" alt="" width="50" height="50" /></a></td>
<td style="vertical-align: middle"><a href="//zappysys.com/products/ssis-powerpack/ssis-salesforce-source-connector/" target="_blank" rel="noopener">Salesforce Source Connector</a></td>
</tr>
</tbody>
</table>
</div>
<h2><span id="Prerequisites">Prerequisites</span></h2>
<ol>
<li>SSIS designer installed. Sometimes it is referred as BIDS or SSDT (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from Microsoft site</a>).</li>
<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
<li>A Salesforce account.</li>
<li>Any SQL Server database.</li>
<li><a href="//zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener"><em>ZappySys SSIS PowerPack</em> installed</a>.</li>
</ol>
<h2>Step-by-Step <span id="Step-by-Step_Get_data_from_HubSpot_API_into_SQL_Server_database"><span id="Step-By-StepGet_data_from_HubSpot_REST_API"><span id="Step-By-Step_8211_Call_Amazon_MWS_API_using_SSIS">– Read Salesforce data in SSIS</span></span></span></h2>
<h3>Get Salesforce Security Token</h3>
<p>The first thing you will need to do to sync Salesforce with SQL Server is to get the Salesforce Security Token. You will need it for <em>Salesforce Source Connector</em> to connect to your Salesforce account:</p>
<ol>
<li>Log in to your account using <a href="https://login.salesforce.com" target="_blank" rel="noopener">https://login.salesforce.com</a>.</li>
<li>On the top right corner, press on your profile picture and click <pre class="crayon-plain-tag">Settings</pre>:
<div id="attachment_10101" style="width: 407px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/09/get-salesforce-security-token-for-ssis-salesforce-connection-manager.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10101" class="wp-image-10101 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/09/get-salesforce-security-token-for-ssis-salesforce-connection-manager.jpg" alt="Getting Salesforce Security Token for use in Salesforce Connection Manager" width="397" height="270" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/get-salesforce-security-token-for-ssis-salesforce-connection-manager.jpg 397w, https://zappysys.com/blog/wp-content/uploads/2017/09/get-salesforce-security-token-for-ssis-salesforce-connection-manager-300x204.jpg 300w" sizes="(max-width: 397px) 100vw, 397px" /></a><p id="caption-attachment-10101" class="wp-caption-text">Getting Salesforce Security Token for use in Salesforce Connection Manager</p></div></li>
<li>On the top left corner, under <em>My Personal Information </em>select <pre class="crayon-plain-tag">Reset My Security Token</pre> menu item:
<div id="attachment_1785" style="width: 259px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/reset-salesforce-security-token-for-use-in-ssis-salesforce-connection-manager.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1785" class="wp-image-1785 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/reset-salesforce-security-token-for-use-in-ssis-salesforce-connection-manager.jpg" alt="Resetting Salesforce Security Token" width="249" height="426" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/reset-salesforce-security-token-for-use-in-ssis-salesforce-connection-manager.jpg 249w, https://zappysys.com/blog/wp-content/uploads/2017/09/reset-salesforce-security-token-for-use-in-ssis-salesforce-connection-manager-175x300.jpg 175w" sizes="(max-width: 249px) 100vw, 249px" /></a><p id="caption-attachment-1785" class="wp-caption-text">Resetting Salesforce Security Token</p></div></li>
<li>In the main window area click <pre class="crayon-plain-tag">Reset Security Token</pre> button:
<div id="attachment_1786" style="width: 772px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/reset-salesforce-security-token-for-use-in-ssis-salesforce-connection-manager-2.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1786" class="wp-image-1786 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/reset-salesforce-security-token-for-use-in-ssis-salesforce-connection-manager-2.jpg" alt="Resetting Salesforce Security Token" width="762" height="305" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/reset-salesforce-security-token-for-use-in-ssis-salesforce-connection-manager-2.jpg 762w, https://zappysys.com/blog/wp-content/uploads/2017/09/reset-salesforce-security-token-for-use-in-ssis-salesforce-connection-manager-2-300x120.jpg 300w" sizes="(max-width: 762px) 100vw, 762px" /></a><p id="caption-attachment-1786" class="wp-caption-text">Resetting Salesforce Security Token</p></div></li>
<li>Check your email for a new Security Token:
<div class="wp-caption" style="margin-top: 0;">
<div id="attachment_1789" style="width: 773px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/check-your-mail-for-new-salesforce-security-token.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1789" class="wp-image-1789 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/check-your-mail-for-new-salesforce-security-token.jpg" alt="Getting new Salesforce Security Token" width="763" height="147" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/check-your-mail-for-new-salesforce-security-token.jpg 763w, https://zappysys.com/blog/wp-content/uploads/2017/09/check-your-mail-for-new-salesforce-security-token-300x58.jpg 300w" sizes="(max-width: 763px) 100vw, 763px" /></a><p id="caption-attachment-1789" class="wp-caption-text">Getting new Salesforce Security Token</p></div>
</div>
</li>
</ol>
<h3>Import Salesforce data into SQL Server</h3>
<p>Once you have Security Token, you can start getting contacts from Salesforce and load them into SQL Server database table:</p>
<ol>
<li>Open SSIS designer.</li>
<li>Create a new SSIS package and drag a <em>Data Flow Task</em> into the <em>Control Flow</em> from the SSIS Toolbox:
<div id="attachment_1795" style="width: 222px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-control-flow.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1795" class="wp-image-1795 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-control-flow.jpg" alt="Starting to create a SSIS package" width="212" height="122" /></a><p id="caption-attachment-1795" class="wp-caption-text">Starting to create a SSIS package</p></div></li>
<li>Open <em>Data Flow Task</em> and then add <i>Salesforce Source </i>from SSIS toolbox:
<div id="attachment_1818" style="width: 255px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-salesforce-source-ssis-component.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1818" class="wp-image-1818 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-salesforce-source-ssis-component.jpg" alt="Using Salesforce Source to start exporting data" width="245" height="192" /></a><p id="caption-attachment-1818" class="wp-caption-text">Using <em>Salesforce Source</em> to start exporting data</p></div></li>
<li>Start modifying <em>Salesforce Source</em> component and then press <pre class="crayon-plain-tag">New</pre> button to create a new<em> Salesforce Connection</em>:
<div id="attachment_1800" style="width: 765px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/use-ssis-salesforce-connection-manager-to-export-data-from-salesforce-to-sql-server.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1800" class="wp-image-1800 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/use-ssis-salesforce-connection-manager-to-export-data-from-salesforce-to-sql-server.jpg" alt="Creating new Salesforce Connection for Salesforce Source" width="755" height="281" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/use-ssis-salesforce-connection-manager-to-export-data-from-salesforce-to-sql-server.jpg 755w, https://zappysys.com/blog/wp-content/uploads/2017/09/use-ssis-salesforce-connection-manager-to-export-data-from-salesforce-to-sql-server-300x112.jpg 300w" sizes="(max-width: 755px) 100vw, 755px" /></a><p id="caption-attachment-1800" class="wp-caption-text">Creating new<em> Salesforce Connection</em> for <em>Salesforce Source</em></p></div></li>
<li>In a new window enter your Salesforce credentials and<em> Security Token</em> you have in your email. In advanced options group, you can select the environment in which the connection will work. Most likely, you want to use <pre class="crayon-plain-tag">Production</pre>, so just select it in <em>Service Type</em> option.<a href="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-using-ssis-salesforce-connection-manager.jpg"><br />
</a></p>
<div id="attachment_1804" style="width: 682px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-using-ssis-salesforce-connection-manager.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1804" class="wp-image-1804 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-using-ssis-salesforce-connection-manager.jpg" alt="Salesforce Connection Manager configuration" width="672" height="531" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-using-ssis-salesforce-connection-manager.jpg 672w, https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-using-ssis-salesforce-connection-manager-300x237.jpg 300w" sizes="(max-width: 672px) 100vw, 672px" /></a><p id="caption-attachment-1804" class="wp-caption-text"><em>Salesforce Connection Manager</em> configuration</p></div></li>
<li>Once you finished creating <em>Salesforce Connection</em>, select <pre class="crayon-plain-tag">Contact</pre> as table you want to get data from. Be sure to have <pre class="crayon-plain-tag">Table</pre> option selected in <em>Access Mode</em>. Also, below you can specify the size of the batch and the maximum number of rows (contacts in our case) to retrieve:
<div id="attachment_1807" style="width: 755px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/ssis-salesforce-source-to-load-data-from-salesforce.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1807" class="wp-image-1807 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/ssis-salesforce-source-to-load-data-from-salesforce.jpg" alt="Choosing Salesforce contacts table to export them to SQL Server" width="745" height="603" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/ssis-salesforce-source-to-load-data-from-salesforce.jpg 745w, https://zappysys.com/blog/wp-content/uploads/2017/09/ssis-salesforce-source-to-load-data-from-salesforce-300x243.jpg 300w" sizes="(max-width: 745px) 100vw, 745px" /></a><p id="caption-attachment-1807" class="wp-caption-text">Choosing Salesforce contacts table to export them to SQL Server</p></div></li>
<li>Close <em>Salesforce Source</em> configuration and in the <em>Data Flow Task </em>drag <em>OLE DB Destination</em> and connect it to <em>Salesforce Source</em>.
<div id="attachment_1796" style="width: 222px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-data-flow.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1796" class="wp-image-1796 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-data-flow.jpg" alt="Connecting Salesforce Source to OLE DB Destination" width="212" height="200" /></a><p id="caption-attachment-1796" class="wp-caption-text">Connecting Salesforce Source to OLE DB Destination</p></div></li>
<li>Open <em>OLE DB Destination</em> configuration, select or create a new connection; in this example, we are using <em>LocalDB</em> and <em>tempdb</em> database. Then select an existing table or create a new one by pressing <pre class="crayon-plain-tag">New</pre> button. Finally, select <pre class="crayon-plain-tag">Mappings</pre> option to map the columns and close the window:
<div id="attachment_1808" style="width: 834px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/use-oledb-destination-to-import-salesforce-data-into-sql-server.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1808" class="wp-image-1808 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/use-oledb-destination-to-import-salesforce-data-into-sql-server.jpg" alt="Choosing connection and table in OLE DB Destination" width="824" height="718" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/use-oledb-destination-to-import-salesforce-data-into-sql-server.jpg 824w, https://zappysys.com/blog/wp-content/uploads/2017/09/use-oledb-destination-to-import-salesforce-data-into-sql-server-300x261.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2017/09/use-oledb-destination-to-import-salesforce-data-into-sql-server-768x669.jpg 768w" sizes="(max-width: 824px) 100vw, 824px" /></a><p id="caption-attachment-1808" class="wp-caption-text">Choosing connection and table in <em>OLE DB Destination</em></p></div></li>
<li>Run the package. In this example we extract 16 contacts and load them into a SQL table:
<div id="attachment_1809" style="width: 250px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-results-1.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1809" class="wp-image-1809 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-results-1.jpg" alt="Package execution result" width="240" height="204" /></a><p id="caption-attachment-1809" class="wp-caption-text">Package execution result</p></div></li>
<li>Let&#8217;s open Salesforce page and take a look at the contacts source. We have 16 contacts here as well:
<div id="attachment_10103" style="width: 702px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-results-2-1-1.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10103" class="wp-image-10103 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-results-2-1-1.jpg" alt="Salesforce source contacts" width="692" height="589" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-results-2-1-1.jpg 692w, https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-results-2-1-1-300x255.jpg 300w" sizes="(max-width: 692px) 100vw, 692px" /></a><p id="caption-attachment-10103" class="wp-caption-text">Salesforce source contacts</p></div></li>
<li>After querying destination table using <a href="https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms" target="_blank" rel="noopener"><acronym title="SQL Server Management Studio">SSMS</acronym></a>, we see that everything worked like it had to:
<div id="attachment_10105" style="width: 607px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-results-3-1.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10105" class="wp-image-10105 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-results-3-1.jpg" alt="Results: contacts exported from Salesforce into SQL Server" width="597" height="353" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-results-3-1.jpg 597w, https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-results-3-1-300x177.jpg 300w" sizes="(max-width: 597px) 100vw, 597px" /></a><p id="caption-attachment-10105" class="wp-caption-text">Results: contacts exported from Salesforce into SQL Server</p></div></li>
<li>You are done!</li>
</ol>
<h3>What if things are more complicated? Queries and Data Filtering</h3>
<p>Instead of accessing data using <pre class="crayon-plain-tag">Table</pre> mode, you can do it in <pre class="crayon-plain-tag">Query</pre> mode. This will let you write T-SQL-like queries where you will be able to filter the data, group it, select the subset of it, etc. Let&#8217;s take the same Salesforce table <pre class="crayon-plain-tag">Contact</pre> and do some basic filtering on it:</p>
<ul>
<li>First of all, let&#8217;s create several variables, which we will use to get specific Salesforce contacts:
<div id="attachment_1829" style="width: 504px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-using-ssis-variables-for-query.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1829" class="wp-image-1829 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-using-ssis-variables-for-query.jpg" alt="Variables used to construct a dynamic query" width="494" height="129" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-using-ssis-variables-for-query.jpg 494w, https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-using-ssis-variables-for-query-300x78.jpg 300w" sizes="(max-width: 494px) 100vw, 494px" /></a><p id="caption-attachment-1829" class="wp-caption-text">Variables used to construct a dynamic query</p></div>
<p>We will use <pre class="crayon-plain-tag">Domain</pre> to filter contacts that have email with <pre class="crayon-plain-tag">uog.com</pre> domain.<br />
<pre class="crayon-plain-tag">From</pre>  variable will help us filter the contacts based on the date, when they were created.</li>
<li>Set <pre class="crayon-plain-tag">Query</pre> in <em>Access Mode</em> option and input query below:
<div id="attachment_1827" style="width: 836px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/sync-salesforce-with-sql-server-using-ssis-salesforce-source-query.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1827" class="wp-image-1827 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/sync-salesforce-with-sql-server-using-ssis-salesforce-source-query.jpg" alt="Inputting a SOQL query into a Salesforce Source SSIS component" width="826" height="602" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/sync-salesforce-with-sql-server-using-ssis-salesforce-source-query.jpg 826w, https://zappysys.com/blog/wp-content/uploads/2017/09/sync-salesforce-with-sql-server-using-ssis-salesforce-source-query-300x219.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2017/09/sync-salesforce-with-sql-server-using-ssis-salesforce-source-query-768x560.jpg 768w" sizes="(max-width: 826px) 100vw, 826px" /></a><p id="caption-attachment-1827" class="wp-caption-text">Inputting a SOQL query into a <em>Salesforce Source </em>SSIS component</p></div>
<p>Even this query looks much like T-SQL query, but in reality it is a SOQL query, an acronym for <a href="https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm" target="_blank" rel="noopener">Salesforce Object Query Language</a>.<br />
<div class="su-note"  style="border-color:#e5dd9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff7b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>NOTE</strong>:</p>
<ul>
<li>We are inputing <strong>{{User::From}}</strong> straight into a query and do not enclose it with single quotes, unlike in T-SQL.</li>
<li>You can explore more SOQL query examples by pressing <strong>« View Examples »</strong> button.</li>
</ul>
</div></div></li>
<li>Click <pre class="crayon-plain-tag">Preview</pre> and you will see that only contacts that have domain &#8220;uog.com&#8221; were retrieved. Filtering on <em>CreatedDate</em> column was applied as well:
<div id="attachment_10107" style="width: 616px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/09/get-data-from-salesforce-and-load-it-into-sql-server-using-ssis-query-results-1.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10107" class="wp-image-10107 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/09/get-data-from-salesforce-and-load-it-into-sql-server-using-ssis-query-results-1.jpg" alt="Data preview for a subset of contacts" width="606" height="338" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/get-data-from-salesforce-and-load-it-into-sql-server-using-ssis-query-results-1.jpg 606w, https://zappysys.com/blog/wp-content/uploads/2017/09/get-data-from-salesforce-and-load-it-into-sql-server-using-ssis-query-results-1-300x167.jpg 300w" sizes="(max-width: 606px) 100vw, 606px" /></a><p id="caption-attachment-10107" class="wp-caption-text">Data preview for a subset of contacts</p></div></li>
</ul>
<p>SOQL has some limitations, so check <a href="https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_limits.htm" target="_blank" rel="noopener">SOQL Limits on Objects</a> page as well if you are writing a more complex query.</p>
<h3>Advanced Options: Convert Datetime Columns</h3>
<p>By default, datetime columns are outputted in <pre class="crayon-plain-tag">yyyy-MM-ddThh:mm:ss.fffZ</pre> format. Yet you can change that and output column in other formats:</p>
<ul>
<li><em>Default format</em> (e.g. <pre class="crayon-plain-tag">2017-07-07T14:41:35.000Z</pre>)</li>
<li><em>Local time</em> (depends on your locale settings e.g. <pre class="crayon-plain-tag">5/16/2017 14:41 PM</pre>)</li>
<li><em>UTC time</em> (depends on your locale settings, yet your time zone is taken into account, e.g. <pre class="crayon-plain-tag">5/16/2017 11:41 PM</pre>)</li>
</ul>
<p>Let&#8217;s take <em>CreatedDate</em> column and output it as UTC time:</p>
<ol>
<li>Here is the preview of data, before conversion:
<div id="attachment_1821" style="width: 604px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/load-data-from-salesforce-into-sql-server-using-ssis-datetime-columns-preview.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1821" class="wp-image-1821 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/load-data-from-salesforce-into-sql-server-using-ssis-datetime-columns-preview.jpg" alt="Data preview before formatting datetime column" width="594" height="318" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/load-data-from-salesforce-into-sql-server-using-ssis-datetime-columns-preview.jpg 594w, https://zappysys.com/blog/wp-content/uploads/2017/09/load-data-from-salesforce-into-sql-server-using-ssis-datetime-columns-preview-300x161.jpg 300w" sizes="(max-width: 594px) 100vw, 594px" /></a><p id="caption-attachment-1821" class="wp-caption-text">Data preview before formatting datetime column</p></div></li>
<li>Now let&#8217;s output the <em>CreatedDate</em> column as UTC time:
<div id="attachment_1822" style="width: 761px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/extract-data-from-salesforce-into-sql-server-using-ssis-datetime-in-utc.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1822" class="wp-image-1822 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/extract-data-from-salesforce-into-sql-server-using-ssis-datetime-in-utc.jpg" alt="Salesforce Source Date/Time Handling" width="751" height="579" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/extract-data-from-salesforce-into-sql-server-using-ssis-datetime-in-utc.jpg 751w, https://zappysys.com/blog/wp-content/uploads/2017/09/extract-data-from-salesforce-into-sql-server-using-ssis-datetime-in-utc-300x231.jpg 300w" sizes="(max-width: 751px) 100vw, 751px" /></a><p id="caption-attachment-1822" class="wp-caption-text">Salesforce Source Date/Time Handling</p></div></li>
<li>Let&#8217;s make another data preview. As you see <em>CreatedDate</em> time shifted to match UTC time:
<div id="attachment_1823" style="width: 604px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/load-data-from-salesforce-into-sql-server-using-ssis-datetime-columns-preview-2.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1823" class="wp-image-1823 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/load-data-from-salesforce-into-sql-server-using-ssis-datetime-columns-preview-2.jpg" alt="Data preview after formatting datetime column" width="594" height="357" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/load-data-from-salesforce-into-sql-server-using-ssis-datetime-columns-preview-2.jpg 594w, https://zappysys.com/blog/wp-content/uploads/2017/09/load-data-from-salesforce-into-sql-server-using-ssis-datetime-columns-preview-2-300x180.jpg 300w" sizes="(max-width: 594px) 100vw, 594px" /></a><p id="caption-attachment-1823" class="wp-caption-text">Data preview after formatting datetime column</p></div></li>
</ol>
<p>Similarly, you can format input datetime columns, when you use <pre class="crayon-plain-tag">Query</pre> <em>Access Mode</em> instead of <pre class="crayon-plain-tag">Table</pre>.</p>
<h2>Common Errors</h2>
<div class="content_block" id="custom_post_widget-1887"><h3>Truncation related error</h3>
<p style="text-align: justify;">The most common error you may face when you run an SSIS package is truncation error. During the design time only 300 rows are scanned from a source (a file or a REST API call response) to detect datatypes but at runtime, it is likely you will retrieve far more records. So it is possible that you will get longer strings than initially expected. For detailed instructions on how to fix common metadata related errors read an article "<a href="//zappysys.com/blog/handling-ssis-component-metadata-issues/" target="_blank" rel="noopener">How to handle SSIS errors (truncation, metadata issues)</a>".</p>

<h3>Authentication related error</h3>
Another frequent error you may get is an authentication error, which happens when you deploy/copy a package to another machine and run it there. Check <a href="#Deployment_to_Production">the paragraph below</a> to see why it happens and how to solve this problem.</div>
<h2>Deployment to Production</h2>
<div class="content_block" id="custom_post_widget-1932"><p style="text-align: justify;">In SSIS package <a href="https://docs.microsoft.com/en-us/sql/integration-services/security/access-control-for-sensitive-data-in-packages" target="_blank" rel="noopener">sensitive data such as tokens and passwords are by default encrypted by SSIS</a> with your Windows account which you use to create a package. So SSIS will fail to decrypt tokens/passwords when you run it from another machine using another Windows account. To circumvent this when you are creating an SSIS package which uses authentication components (e.g. an <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-oauth-connection-manager.htm" target="_blank" rel="noopener">OAuth Connection Manager</a> or an <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-http-connection-manager.htm" target="_blank" rel="noopener">HTTP Connection Manager</a> with credentials, etc.), consider using parameters/variables to pass tokens/passwords. In this way, you won’t face authentication related errors when a package is deployed to a production server.</p>
<p style="text-align: justify;">Check our article on <a href="https://zappysys.com/blog/how-to-run-an-ssis-package-with-sensitive-data-on-sql-server/" target="_blank" rel="noopener">how to configure packages with sensitive data on your production or development server</a>.</p></div>
<h2>Download Sample Package</h2>
<p>Be sure to download a <a href="//zappysys.com/blog/wp-content/uploads/2017/09/Export-data-from-Salesforce-to-SQL-Server-using-SSIS.zip" rel="noopener">sample SQL Server 2008 SSIS package</a>, in case you want to try it right away (you can upgrade it to a higher version).</p>
<div><div class="su-note"  style="border-color:#e5dd9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff7b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>NOTE</strong>: Once you open the package, you won’t be able to run it immediately, but don’t panic. Just configure <em>OLE DB Source</em> to point to your database and set your Salesforce account credentials in <em>Salesforce Connection Manager</em>.</div></div></div>
<h2>Conclusion</h2>
<p>In this article, you learned how to export data from Salesforce to SQL Server. We used <a href="//zappysys.com/products/ssis-powerpack/ssis-salesforce-source-connector/" target="_blank" rel="noopener">Salesforce Source</a> to extract contacts from Salesforce and import them into a SQL Server database table. We did not have to configure much, just a few clicks and you were done. Also you learned how to use <a href="https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_sosl_intro.htm" target="_blank" rel="noopener">SOQL</a> to write custom queries and filter out the data you don&#8217;t need. Finally, now you know how to convert datetime columns into Local and UTC time to match the format you expect in your database.</p>
<p><strong>Keywords</strong><br />
Salesforce SQL Server Integration | Data loading Salesforce | Salesforce API SQL Server | Get data from Salesforce and load into SQL Server | Read data from Salesforce and write it to SQL Server  | Extract data from Salesforce to SQL Server</p>
<p>The post <a href="https://zappysys.com/blog/export-data-from-salesforce-to-sql-server-using-ssis/">How to read Salesforce data in SSIS &#8211; Export to SQL Server</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
