<?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>Regular Expression Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/tag/regular-expression/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/tag/regular-expression/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Tue, 23 Sep 2025 23:00:11 +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>Regular Expression Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/tag/regular-expression/</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>Extract audit data from SSIS Execution Log (EventHandler and Regular Expression)</title>
		<link>https://zappysys.com/blog/extract-audit-data-ssis-execution-log-eventhandler-regular-expression/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Tue, 26 May 2020 20:11:33 +0000</pubDate>
				<category><![CDATA[SSIS CSV Export Task]]></category>
		<category><![CDATA[SSIS Logging Task]]></category>
		<category><![CDATA[SSIS Regex Parser Task]]></category>
		<category><![CDATA[audit]]></category>
		<category><![CDATA[EventHandler]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[Regular Expression]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=8928</guid>

					<description><![CDATA[<p>Introduction In our last post (Regex Cheat Sheet) we explained use cases of SSIS Regular Expression Parser Task . Now lets look at some real world usecase. Basically in this article we are going to Extract data from audit log using SSIS. For demo purpose we will use log generated by SSIS Export CSV File Task output. When [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/extract-audit-data-ssis-execution-log-eventhandler-regular-expression/">Extract audit data from SSIS Execution Log (EventHandler and Regular Expression)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In our <a href="https://zappysys.com/blog/using-regular-expressions-in-ssis/" target="_blank" rel="noopener">last post</a> (Regex Cheat Sheet) we explained use cases of <a href="https://zappysys.com/products/ssis-powerpack/ssis-regex-parser-task/" target="_blank" rel="noopener">SSIS Regular Expression Parser Task</a> . Now lets look at some real world usecase. Basically in this article we are going to Extract data from audit log using SSIS. For demo purpose we will use log generated by <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-csv-file-task/" target="_blank" rel="noopener">SSIS Export CSV File Task output</a>. When you export many tables dynamically using this task you want to know how many Row count exported for each Table. This information is logged in SSIS Output Log but no easy way to capture in SSIS variable. So what we will do we will use few tricks to capture that data using Regular Expression usecase.</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>Setup Export CSV Task (Output Multiple Tables to CSV Files Dynamically)</h2>
<p>For example purpose we will use Export CSV File Task but you can use this technique for any other Tasks.</p>
<ol>
<li>Drag and Drop ZS Export CSV Task from SSIS Toolbox and configure as below.<br />
<img decoding="async" class="figureimage" title="SSIS Export to CSV File Task - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/export-csv-file-task/ssis-export-csv-file-task-drag.png" alt="SSIS Export to CSV File Task - Drag and Drop" /></li>
<li>  Configure Export CSV Task to output multiple tables <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/export-csv-file-task.htm" target="_blank" rel="noopener">as explained here</a></li>
<li>Now create 2 SSIS User Variables
<ol>
<li><strong>FilePath</strong> (String Type)</li>
<li><strong>RowCount</strong> (String Type)</li>
</ol>
</li>
</ol>
<p>That&#8217;s it&#8230; now in the next section we will setup event handler to capture output from Log.</p>
<h2>Setup EventHandle / Extract Audit Data using Regex</h2>
<ol>
<li>Now select task and click <strong>Event Handler tab</strong></li>
<li>Select <strong>Executable Name</strong> from the dropdown, Select Event Name <strong>OnInformation</strong> from Handler Dropdown</li>
<li>Click Create Hyper Link to Create Event Handler like below
<div id="attachment_8929" style="width: 665px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-create-eventhandler.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8929" class="size-full wp-image-8929" src="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-create-eventhandler.png" alt="Create Task Level Event Handler in SSIS" width="655" height="260" srcset="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-create-eventhandler.png 655w, https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-create-eventhandler-300x119.png 300w" sizes="(max-width: 655px) 100vw, 655px" /></a><p id="caption-attachment-8929" class="wp-caption-text">Create Task Level Event Handler in SSIS</p></div></li>
<li>Now Drag below 3 tasks and connect like this
<ol>
<li>Script Task (We will use as dummy start (No configuration needed)</li>
<li>ZS Regular Expression Parser Task</li>
<li>ZS Logging Task (Optional) but we will use to Output Extracted Values<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-eventhandler-extract-audit-information.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-8930" src="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-eventhandler-extract-audit-information.png" alt="" width="828" height="490" srcset="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-eventhandler-extract-audit-information.png 828w, https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-eventhandler-extract-audit-information-300x178.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-eventhandler-extract-audit-information-768x454.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></a></li>
</ol>
</li>
<li>Connect Dummy Script Task to ZS Regular Expression Parser Task and Right click on Green connected Arrow and Use Expression as below. Click OK to save</li>
<li>Configure ZS Regular Expression Parser Task as below
<ol>
<li>Enter <pre class="crayon-plain-tag">{{System::ErrorDescription}}</pre>  as Direct Value</li>
<li>Enter Below two mappings
<ol>
<li>For RowCount set<br />
<pre class="crayon-plain-tag">Total (\d+) records written to : (.*){{1,1}}</pre>
</li>
<li>For FilePath set<br />
<pre class="crayon-plain-tag">Total (\d+) records written to : (.*){{1,2}}</pre>
</li>
</ol>
</li>
</ol>
</li>
<li>Here is how it will look like
<div id="attachment_8932" style="width: 912px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-regular-expression-extract-audit-log-data.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8932" class="wp-image-8932 size-full" src="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-regular-expression-extract-audit-log-data.png" alt="Extract data from audit log using SSIS Regular Expression Parser Task" width="902" height="838" srcset="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-regular-expression-extract-audit-log-data.png 902w, https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-regular-expression-extract-audit-log-data-300x279.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-regular-expression-extract-audit-log-data-768x714.png 768w" sizes="(max-width: 902px) 100vw, 902px" /></a><p id="caption-attachment-8932" class="wp-caption-text">Extract data from audit log using SSIS Regular Expression Parser Task</p></div></li>
<li>Thats it&#8230; Now connect 2nd step to last Logging Task&#8230;. in that Task you can set Text like below just to log extracted data. You can also use Execute SQL Task to log into Database Table<br />
<pre class="crayon-plain-tag">{{User::FilePath}} ===&gt; {{User::RowCount}}</pre>
</li>
<li>Now run Package and you will see audit data we extracted for each file. Once File is exported we capture OnInformation event&#8230; and if Message contains substring like &#8220;records written to&#8221; then we extract data into variable for Row Count and Path then you can save to desired place for auditing purpose<a href="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-log-extracted-audit-information.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-8931" src="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-log-extracted-audit-information.png" alt="" width="656" height="163" srcset="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-log-extracted-audit-information.png 656w, https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-log-extracted-audit-information-300x75.png 300w" sizes="(max-width: 656px) 100vw, 656px" /></a></li>
</ol>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/extract-audit-data-ssis-execution-log-eventhandler-regular-expression/">Extract audit data from SSIS Execution Log (EventHandler and Regular Expression)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Using Regular Expressions in SSIS</title>
		<link>https://zappysys.com/blog/using-regular-expressions-in-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 07 Mar 2018 17:38:24 +0000</pubDate>
				<category><![CDATA[SSIS Advanced File System Task]]></category>
		<category><![CDATA[SSIS Amazon Storage Task]]></category>
		<category><![CDATA[SSIS Azure Blob Storage Task]]></category>
		<category><![CDATA[SSIS Regex Parser Task]]></category>
		<category><![CDATA[SSIS SFTP Task]]></category>
		<category><![CDATA[SSIS Tasks]]></category>
		<category><![CDATA[SSIS Tips & How-Tos]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[Regular Expression]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=2858</guid>

					<description><![CDATA[<p>Introduction In this short article, you will learn how to write Regular expressions in SSIS (i.e. Regex) and what tool to use to test them. You will also find helpful resources on how to write more sophisticated expressions and learn more about them. For demo purposes, we will use FREE SSIS Regex Parser Task to parse and [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/using-regular-expressions-in-ssis/">Using Regular Expressions in SSIS</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/2018/03/ssis-regex-parser-task.png"><img loading="lazy" decoding="async" class=" wp-image-2974 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-regex-parser-task.png" alt="" width="114" height="114" /></a>In this short article, you will learn how to write Regular expressions in SSIS (i.e. Regex) and what tool to use to test them. You will also find helpful resources on how to write more sophisticated expressions and learn more about them. For demo purposes, we will use <strong>FREE</strong> <a href="https://zappysys.com/products/ssis-powerpack/ssis-regex-parser-task/" target="_blank" rel="noopener">SSIS Regex Parser Task</a> to parse and extract the text using Regex.</p>
<p>&nbsp;</p>
<p>You can use Regular expressions in several SSIS PowerPack connectors:</p>
<ul>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-regex-parser-task/" target="_blank" rel="noopener">SSIS Regex Parser Task (FREE)</a>,</li>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-azure-blob-storage-task/" target="_blank" rel="noopener">Azure Blob Storage Task</a>,</li>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/" target="_blank" rel="noopener">Advanced File System Task</a>,</li>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-s3-task/" target="_blank" rel="noopener">Amazon S3 Storage Task</a> and others.</li>
</ul>
<h2>Writing Regular Expressions in SSIS</h2>
<p>Based on the SSIS component you use it will include the filename in filtering options or match the text: See below Syntax to write Regex in ZappySys tools. We support additional construct {{X, Y}} at the end of Regex to control two parameters. This additional construct is useful for data extracted from matching regex. If you want to Test patterns and not worry about data extraction then no need to use last {{<pre class="crayon-plain-tag">Occurance_Index</pre>, <pre class="crayon-plain-tag">Group_Index_Or_Name</pre>}}</p>
<p><strong>Syntax:</strong><br />
<pre class="crayon-plain-tag">&lt;your Regular Expression&gt;[{{Occurance_Index|*[,Group_Index_Or_Name]}}]</pre>
<p><strong>Where:</strong><br />
<pre class="crayon-plain-tag">Occurance_Index</pre>=Occurrence index you want to extract (X=0 means the first match) and * means all matches. Use a minus sign to get an occurrence from reverse (e.g. {{-0}} returns the last match)<br />
<pre class="crayon-plain-tag">Group_Index_Or_Name</pre>=Group index/name within your search pattern (Groups are indicated by parentheses in regular expression, Y=0 means first group). If you named your group in the pattern then you can use the Group name. To use Group Name you must use the new version (the old version doesn&#8217;t support this)</p>
<p><strong>How to name a group?</strong></p>
<p>E.g. (\w+)@(<strong>?&lt;domain&gt;</strong>\w+.com)</p>
<p><strong>How to use the group name in the match extract?</strong></p>
<p>E.g. (\w+)@(<strong>?&lt;domain&gt;</strong>\w+.com){{0,<strong>domain</strong>}}</p>
<p><strong>Example Input:</strong></p>
<p>Let&#8217;s assume we have the following input text. We will test various Expressions.</p><pre class="crayon-plain-tag">Customer =&gt; AAA
Email =&gt; aaa@google.com
Phone =&gt; 101-222-3333
========
Customer =&gt; BBB
Email =&gt; bbb@yahoo.com
Phone =&gt; 102-222-3333
========
Customer =&gt; CCC
Email =&gt; ccc@hotmail.com
Phone =&gt; 103-222-3333
========
Customer =&gt; DDD
Email =&gt; ddd@outlook.com
Phone =&gt; 104-222-3333</pre><p>
<strong>Sample Regex Expressions</strong></p>
<div class="su-table su-table-alternate">
<table style="border-collapse: collapse;width: 100%;height: 332px" border="1">
<tbody>
<tr style="height: 22px">
<td style="width: 50%;height: 22px"><strong>Expression</strong></td>
<td style="width: 50%;height: 22px"><strong>Description</strong></td>
</tr>
<tr style="height: 46px">
<td style="width: 50%;height: 46px">(?s).*</td>
<td style="width: 50%;height: 46px">Match anything including new lines. To match anything without new line just use <pre class="crayon-plain-tag">(.*)</pre></td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">\w+([-+.&#8217;]\w+)*@(?&lt;domain&gt;\w+([-.]\w+)*\.\w+([-.]\w+)*)</td>
<td style="width: 50%;height: 22px">Get first email id from text ({{0}} is omitted from end because {{0}} id default)</td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">\w+([-+.&#8217;]\w+)*@(?&lt;domain&gt;\w+([-.]\w+)*\.\w+([-.]\w+)*){{-0}}</td>
<td style="width: 50%;height: 22px">Get last email id from text</td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">\w+([-+.&#8217;]\w+)*@(?&lt;domain&gt;\w+([-.]\w+)*\.\w+([-.]\w+)*){{*}}</td>
<td style="width: 50%;height: 22px">Get all email addresses (separate them with new line). When you suffix Regular expression with {{*}} it will return all matches.</td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">\w+([-+.&#8217;]\w+)*@(?&lt;domain&gt;\w+([-.]\w+)*\.\w+([-.]\w+)*){{2}}</td>
<td style="width: 50%;height: 22px">Get third email id from text (i.e. ends with {{X}} where X is occurrence index starting from 0)</td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">\w+([-+.&#8217;]\w+)*@(?&lt;domain&gt;\w+([-.]\w+)*\.\w+([-.]\w+)*){{0,2}}</td>
<td style="width: 50%;height: 22px">Get first email pattern match (i.e. Index=0) and extract domain (i.e. 2nd group). Index starting from 0 for occurrence and group</td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">(\d*)-(\d*)-(\d*)</td>
<td style="width: 50%;height: 22px">Get first phone number from text (If you don&#8217;t include {{X,Y}} at the end then it will be always [0,0])</td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">^((?!demo|test).)*$</td>
<td style="width: 50%;height: 22px">Match whole input text if it does not contain words like demo or test. If word found then No Match</td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">&lt;tag&gt;((.|\n)*?)&lt;/tag&gt;{{0,1}}</td>
<td style="width: 50%;height: 22px">Extract anything between &lt;tag&gt;&#8230;&lt;/tag&gt; (Include new line char i.e. \n)</td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">&lt;tag&gt;(.*)&lt;/tag&gt;{{0,1}}</td>
<td style="width: 50%;height: 22px">Extract anything between &lt;tag&gt;&#8230;&lt;/tag&gt; (Exclude new line char i.e. \n)</td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">&lt;!\[CDATA\[((.|\n)*?)\]\]\&gt;{{0,1}}</td>
<td style="width: 50%;height: 22px">Extract content from CData section of XML Data (This can be CSV, JSON or nested XML )</td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">^$</td>
<td style="width: 50%;height: 22px">Match blank string</td>
</tr>
</tbody>
</table>
</div>
<h2>More Regular Expression Examples</h2>
<div class="su-table su-table-alternate">
<table>
<tbody>
<tr>
<td style="width: 196px"><strong>Input Text</strong></td>
<td style="width: 223px"><strong>Regex</strong></td>
<td style="width: 163px"><strong>Matched text</strong></td>
<td style="width: 752px"><strong>Comment</strong></td>
</tr>
<tr>
<td style="width: 196px">&lt;row id=&#8221;123&#8243; process=&#8221;Y&#8221;&gt;</td>
<td style="width: 223px">id=&#8221;([^&#8221;]*)&#8221;{{0,1}}</td>
<td style="width: 163px"><strong>123</strong></td>
<td style="width: 752px">This expression shows how to extract group value (i.e. {{0,1}} &#8211; first match and 2nd group ). It extracts text between double quotes using <strong>[^&#8221;]*</strong> pattern , match anything until double quote is found.  {{0,1}} syntax is ZappySys specific so it may not work with other Regex engines.</td>
</tr>
<tr>
<td style="width: 196px">&lt;data&gt;123&lt;/data&gt;</td>
<td style="width: 223px">&lt;data&gt;([^&lt;]*)&lt;\/data&gt;{{0,1}}</td>
<td style="width: 163px"><strong>123</strong></td>
<td style="width: 752px">This expression shows how to extract group value (i.e. {{0,1}} &#8211; first match and 2nd group ). It extracts text between double quotes using <strong>[^&lt;]*</strong> pattern , match anything until <strong>&lt;</strong>  is found.  {{0,1}} syntax is ZappySys specific so it may not work with other Regex engines.</td>
</tr>
<tr>
<td style="width: 196px" valign="top">File_20180930_source.txt</td>
<td style="width: 223px" valign="top">File</td>
<td style="width: 163px" valign="top"><strong>File</strong></td>
<td style="width: 752px" valign="top">Will match text/filename that has &#8220;File&#8221; keyword in it.</td>
</tr>
<tr>
<td style="width: 196px" valign="top">File_20180930_SOURCE.dat<br />
File_20180930_source.dat</td>
<td style="width: 223px" valign="top">source|SOURCE</td>
<td style="width: 163px" valign="top"><strong>SOURCE</strong> and <strong>source</strong></td>
<td style="width: 752px" valign="top">Will match text/filenames that contain either &#8220;source&#8221; <strong>or</strong> &#8220;SOURCE&#8221; keyword.</td>
</tr>
<tr>
<td style="width: 196px" valign="top">File_20180930_source.txt</td>
<td style="width: 223px" valign="top">File.+source</td>
<td style="width: 163px" valign="top"><strong>File_20180930_source</strong></td>
<td style="width: 752px" valign="top">Will match text/filename that contains keyword that starts with &#8220;File&#8221; <strong>and</strong> ends with &#8220;source&#8221;.<br />
Basically, you can use this pattern if you want to match two keywords in the text that appear in particular order.</td>
</tr>
<tr>
<td style="width: 196px" valign="top">File_20180930_source.txt<br />
File_20180830_source.dat</td>
<td style="width: 223px" valign="top">\.txt$|\.dat$</td>
<td style="width: 163px" valign="top"><strong>.txt</strong> and <strong>.dat</strong></td>
<td style="width: 752px" valign="top">Will match text/all filenames that end with &#8220;.txt&#8221; <strong>or</strong> &#8220;.dat&#8221;.</td>
</tr>
<tr>
<td style="width: 196px" valign="top">File_20180930_source.txt<br />
file_20190102_source.txt</td>
<td style="width: 223px" valign="top">^(F|f)ile_\d{8}</td>
<td style="width: 163px" valign="top"><strong>File_20180930</strong><br />
<strong>file_20190102</strong></td>
<td style="width: 752px" valign="top">Will match text/filename that starts with &#8220;File_&#8221; <strong>or</strong> &#8220;file_&#8221; <strong>and</strong> then followed by 8 digits.</td>
</tr>
<tr>
<td style="width: 196px" valign="top">File_20180930_source.txt<br />
File_20190101_none.txt</td>
<td style="width: 223px" valign="top">(.+)_(.+)_(.+){{0,2}}</td>
<td style="width: 163px" valign="top"><strong>20180930</strong></td>
<td style="width: 752px" valign="top">Will match text that has three groups of text strings, separated by &#8220;_&#8221;.<br />
Non-Regex {{0,2}} notation will bring back second group (index &#8220;2&#8221;) of first match (index &#8220;0&#8221;).</td>
</tr>
<tr>
<td style="width: 196px">File_20180930_source.txt<br />
File_20190101_none.txt</td>
<td style="width: 223px">(.+)_(.+)_(.+){{1,2}}</td>
<td style="width: 163px"><strong>20190101</strong></td>
<td style="width: 752px">Will match text that has three groups of text strings, separated by &#8220;_&#8221;.<br />
Non-Regex {{1,2}} notation will bring back second group (index &#8220;2&#8221;) of second match (index &#8220;1&#8221;).</td>
</tr>
<tr>
<td style="width: 196px">File_20180930_source.txt<br />
File_20190101_none.txt</td>
<td style="width: 223px">(.+)_(.+)_(.+){{*,2}}</td>
<td style="width: 163px"><strong>20180930<br />
20190101<br />
</strong></td>
<td style="width: 752px">Will match text that has three groups of text strings, separated by &#8220;_&#8221;.<br />
Non-Regex {{*,2}} notation will bring back second group (index &#8220;2&#8221;) of all matches (index &#8220;*&#8221;). Returned matches are separated by \r\n</td>
</tr>
<tr>
<td style="width: 196px">&lt;html&gt;<br />
&lt;img src=&#8221;/img-1.png&#8221; /&gt;<br />
&lt;img src=&#8221;/img-2.png&#8221; /&gt;<br />
&lt;img src=&#8221;/img-3.png&#8221; /&gt;<br />
<span style="font-family: inherit;font-size: inherit">&lt;/html&gt;</span></td>
<td style="width: 223px">&lt;img[^&gt;]+src=&#8221;([^&#8221;&gt;]+)&#8221;{{*,1}}</td>
<td style="width: 163px"><strong>/img-1.png<br />
/img-2.png<br />
/img-3.png<br />
</strong></td>
<td style="width: 752px">Will return image URLs from HTML content. We used {{*,1}} means it will pull all occurrences and for each match it will extract first group (which is just src attribute value).</td>
</tr>
<tr>
<td style="width: 196px">null</td>
<td style="width: 223px">^((?!null\b).)*$</td>
<td style="width: 163px"><strong>&lt;blank&gt;</strong></td>
<td style="width: 752px">Returns blank if null word found (match all except null)</td>
</tr>
<tr>
<td style="width: 196px">black white</td>
<td style="width: 223px">^((?!red|blue|orange).)*$</td>
<td style="width: 163px"><strong>black white</strong></td>
<td style="width: 752px">Returns full string as is if any of those 3 words (i.e. red, blue, orange) not found anywhere in the string</td>
</tr>
<tr>
<td style="width: 196px">black white red</td>
<td style="width: 223px">^((?!red|blue|orange).)*$</td>
<td style="width: 163px"><strong>&lt;blank&gt;</strong></td>
<td style="width: 752px">Returns blank if any of those 3 words (i.e. red, blue, orange) found anywhere in the string</td>
</tr>
</tbody>
</table>
</div>
<h2>Regex Examples (Using SSIS Regular Expression Parser Task)</h2>
<p>Here is an example how Regex <pre class="crayon-plain-tag">(.+)_(.+)_(.+){{1,2}}</pre> works in <a href="https://zappysys.com/products/ssis-powerpack/ssis-regex-parser-task/" target="_blank" rel="noopener">Regular Expression Parser Task (FREE)</a>:</p>
<div id="attachment_2978" style="width: 742px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis_powerpack_regular_expression_parser_task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2978" class="wp-image-2978 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis_powerpack_regular_expression_parser_task-e1520866478970.png" alt="Using Regular Expressions in SSIS Regex Parser Task (Extract Groups)" width="732" height="612" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis_powerpack_regular_expression_parser_task-e1520866478970.png 732w, https://zappysys.com/blog/wp-content/uploads/2018/03/ssis_powerpack_regular_expression_parser_task-e1520866478970-300x251.png 300w" sizes="(max-width: 732px) 100vw, 732px" /></a><p id="caption-attachment-2978" class="wp-caption-text">Using Regular Expressions in SSIS Regex Parser Task (Extract Groups)</p></div>
<h2>Using Groups / Occurrence Index</h2>
<p>Some tasks like <a href="https://zappysys.com/products/ssis-powerpack/ssis-regex-parser-task/" target="_blank" rel="noopener">SSIS Regex Parser Task (FREE)</a> supports extracting value from specific occurrence and specific part of matched pattern using special syntax at the end of your pattern (see below).</p><pre class="crayon-plain-tag">Your Regex Pattern Here{{OccuranceIndex,GroupIndex}}</pre><p>
<strong>Where :</strong><br />
OccuranceIndex is 0 based (0=extract first occurrence)<br />
GroupIndex is 0 based (0=extract first matching group from pattern. First group is always entire text. )</p>
<p>See above screenshot in previous section for example.</p>
<h2>Tools</h2>
<p>The best tool we&#8217;ve found to write and test Regex is <a href="http://regexhero.net/tester/" target="_blank" rel="noopener">Regex Hero</a> (will require IE with Silverlight if you want to use it online, in the browser):</p>
<p>Another great site for Regex testing is <a href="https://regex101.com" target="_blank" rel="noopener">https://regex101.com</a> (Works in any browser unlike previous one)</p>
<p>and few more sites as below</p>
<p><a href="http://www.regexr.com/" target="_blank" rel="noopener">http://www.regexr.com/</a><br />
<a href="http://www.regexlib.com/" target="_blank" rel="noopener">http://www.regexlib.com/</a><br />
<a href="http://www.regular-expressions.info/" target="_blank" rel="noopener">http://www.regular-expressions.info/</a></p>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis_powerpack_regular_expression_task_using_regex_hero.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2972" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis_powerpack_regular_expression_task_using_regex_hero.png" alt="" width="802" height="483" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis_powerpack_regular_expression_task_using_regex_hero.png 802w, https://zappysys.com/blog/wp-content/uploads/2018/03/ssis_powerpack_regular_expression_task_using_regex_hero-300x181.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/03/ssis_powerpack_regular_expression_task_using_regex_hero-768x463.png 768w" sizes="(max-width: 802px) 100vw, 802px" /></a></p>
<h2>Resources</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/Regular-expressions-quick-reference.pdf">Regular Expressions cheat-sheet to hang on the wall</a></p>
<p><a href="http://www.rexegg.com/regex-quickstart.html" target="_blank" rel="noopener">Regular Expressions quick reference</a></p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/using-regular-expressions-in-ssis/">Using Regular Expressions in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Search and replace in files using SSIS &#8211; No Coding</title>
		<link>https://zappysys.com/blog/search-and-replace-in-files-using-ssis-no-coding/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Thu, 03 Dec 2015 23:29:37 +0000</pubDate>
				<category><![CDATA[SSIS Advanced File System Task]]></category>
		<category><![CDATA[Regular Expression]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=204</guid>

					<description><![CDATA[<p>Introduction Many times you have requirement to search and replace in files (single or multiple file) content using SSIS. If you are not C# or VB.net programmer then you may find yourself at dead end struggling how to achieve this in SSIS. If you have this need then you can use Advanced File System Task [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/search-and-replace-in-files-using-ssis-no-coding/">Search and replace in files using SSIS &#8211; No Coding</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>Many times you have requirement to search and replace in files (single or multiple file) content using SSIS. If you are not C# or VB.net programmer then you may find yourself at dead end struggling how to achieve this in SSIS. If you have this need then you can use <a href="//zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/">Advanced File System Task</a></p>
<h2>Search and replace in files using Simple text search</h2>
<p>In this option you can specify text you want to search and text you want to replace with. You can check ignore text if you dont want case-sensitive search/replace.</p>
<h2>Extended text search (special characters allowed)</h2>
<p>For extended search mode you may use any of the following in your search/replace string</p>
<ul>
<ul>
<li>\n &#8211; for line feed</li>
<li>\r &#8211; for return character</li>
<li>\0 &#8211; for null character</li>
<li>\t &#8211; for tab character</li>
<li>\v &#8211; for vertical tab character</li>
</ul>
</ul>
<p>Example:<br />
Search: &#8220;Hello\r\nWorld&#8221;<br />
Replace: &#8220;Hello World&#8221;</p>
<h2>Regular expression search/replace</h2>
<div id="attachment_205" style="width: 722px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/file-search-replace-text-in-ssis.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-205" class="size-full wp-image-205" src="//zappysys.com/blog/wp-content/uploads/2015/12/file-search-replace-text-in-ssis.png" alt="Search and Replace File Content in SSIS (Find sub string, Search for special character)" width="712" height="491" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/file-search-replace-text-in-ssis.png 712w, https://zappysys.com/blog/wp-content/uploads/2015/12/file-search-replace-text-in-ssis-300x207.png 300w" sizes="(max-width: 712px) 100vw, 712px" /></a><p id="caption-attachment-205" class="wp-caption-text">Search and Replace File Content in SSIS (Find sub string, Search for special character)</p></div>
<h2>Advanced File System Task</h2>
<p>If you want to perform some other operations then here is the list of few features supported by Advanced File System Task.</p>
<ul>
<li>File operations for single or multiple files using wildcard(e.g. copy, move, rename, delete, write to file, get properties)</li>
<li>Folder operations such as delete folder and create folder</li>
<li>Support for bulk rename (e.g. by specifying {%name%}.{%ext%}.old as new name will rename all selected files to *.old)</li>
<li>Search and Replace in files (Regular expression search supported)</li>
<li>Change file encoding</li>
<li>Get file properties as data table which you can loop easily (Using ForEach Loop – ADO Enumerator)</li>
<li>Option to continue on error (e.g. Copy file only when source file found)</li>
<li>Auto create missing target directory</li>
<li>Use placeholders anywhere in the path, makes it easy to timestamp folders or files (e.g. c:\Archive\{{System::StartTime,yyyMMdd}})</li>
<li>Regular Expression based Include Pattern (e.g. ^(file\d\d).(\w+)$ will include file01.exe,file22.csv …)</li>
<li>Regular Expression based Exclude Pattern (e.g. (.exe|.msi) will exclude files with extension exe or msi)</li>
<li>Sort based on specific property (e.g. Order Size DESC – extract top 10 files by size)</li>
<li>Advanced SQL like filter support (e.g. Size&gt; 1024 AND AgeInDays &gt; 10 AND Extension IN(‘.txt’,’.csv’) will include file greater than 1024 bytes and extension is txt or csv)</li>
<li>Support for Regular Expression based Include Pattern (e.g. ^(Customer\d\d).(\w+)$ )</li>
<li>Support for SQL Server 2005, 2008, 2012, 2014, 2016 (32 bit and 64 bit)</li>
</ul>
<h2>Download FREE SSIS Components</h2>
<p><a href="https://zappysys.com/products/ssis-powerpack/"><img decoding="async" src="//zappysys.com/wp-content/uploads/2016/10/slider-ssis-powerpack-1.png"></a></p>
<h2>Conclusion</h2>
<p>Search and replace in many files can be tricky but using <a href="//zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/">Advanced File System Task</a> it can be few click. <a href="//zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/">Click here </a> to download.</p>
<p>The post <a href="https://zappysys.com/blog/search-and-replace-in-files-using-ssis-no-coding/">Search and replace in files using SSIS &#8211; No Coding</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>JSONPath Expression Examples &#8211; JSON Cheatsheet (SSIS / ODBC)</title>
		<link>https://zappysys.com/blog/jsonpath-examples-expression-cheetsheet/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 21 Oct 2015 23:17:00 +0000</pubDate>
				<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS Tips & How-Tos]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[jsonpath]]></category>
		<category><![CDATA[odbc]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[Regular Expression]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=75</guid>

					<description><![CDATA[<p>What is JSONPath expression JSONPath expression is an expression language to filter JSON Data. Its a similar concept to XPath expression in XML but has limited features compared to XPath. If you are extracting data from REST API Services using SSIS JSON / XML Source or ODBC JSON / XML Driver then you will quickly realize [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/jsonpath-examples-expression-cheetsheet/">JSONPath Expression Examples &#8211; JSON Cheatsheet (SSIS / ODBC)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>What is JSONPath expression</h2>
<p style="text-align: left;"><a href="https://zappysys.com/blog/wp-content/uploads/2017/07/how-to-180x180.png"><img loading="lazy" decoding="async" class=" wp-image-2223 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2017/07/how-to-180x180.png" alt="" width="86" height="86" /></a><a href="https://goessner.net/articles/JsonPath/" target="_blank" rel="noopener">JSONPath</a> expression is an expression language to filter JSON Data. Its a similar concept to XPath expression in XML but has limited features compared to XPath. If you are extracting data from REST API Services using <a href="//zappysys.com/products/ssis-powerpack/ssis-json-file-source/">SSIS JSON / XML Source</a> or <a href="https://zappysys.com/products/odbc-powerpack/odbc-json-rest-api-driver/" target="_blank" rel="noopener">ODBC JSON / XML Driver</a> then you will quickly realize that it&#8217;s very important to extract nested data by navigating to a certain level.</p>
<h2></h2>
<h2></h2>
<p>&nbsp;</p>
<h2>Sample data for JSONPath expression</h2>
<p>All examples of JSONPath expression in this post will use the following sample JSON for reference.</p>
<div>
<pre class="crayon-plain-tag">{
  "store": {
    "books": [
      {
        "category": "reference",
        "author": "Nigel Rees",
        "title": "Sayings of the Century",
        "price": 8.95,
        "sections": ["s1", "s2", "s3"],
        "publicationDay": "2023-05-10"
      },
      {
        "category": "fiction",
        "author": "Evelyn Waugh",
        "title": "Sword of Honour",
        "price": 12.99,
        "sections": ["s4", "s1", "s3"],
        "publicationDay": "2022-08-10"
      },
      {
        "category": "fiction",
        "author": "Herman Melville",
        "title": "Moby Dick",
        "isbn": "0-553-21311-3",
        "price": 8.99,
        "sections": ["s1"],
        "publicationDay": "1851-10-11"
      },
      {
        "category": "fiction",
        "author": "J. R. R. Tolkien",
        "title": "The Lord of the Rings",
        "isbn": "0-395-19395-8",
        "price": 22.99,
        "sections": ["s8", "s9"],
        "publicationDay": "1954-07-12"
      }
    ],
    "time": {
      "starttime": "8:00",
      "endtime": "18:00"
    }
  }
}</pre>
</div>
<h2>JSONPath Examples</h2>
<pre class="crayon-plain-tag">//get all books for store
$.store.books[*]
                     
//get all sections from all books
$.store.books[*].sections[*]     

//get all authors of all books for store
$.store.books[*].author  
             
//get 3rd book record 
$.store.books[2]    

//get first 2 books from the top
$.store.books[:2]   

//get last 2 books
$.store.books[-2:]
  
//get all books where author attribute equals to 'sam'
$.store.books[?(@author=='Nigel Rees')] 

//get all documents / sub documents (any level) where author attribute equals to 'sam'
$..[?(@author=='Nigel Rees')] 

//get books where price is less than 10
$.store.books[?(@.price&lt;10)] 

//filter all books with tag
$.store.books[?(@.tag)]

//find all books which contains section s1 or s2 (Use of Logical operator OR ( || )
$.store.books[?(@.sections[*]=='s1' || @.sections[*]=='s2' )]

//find all books where first section is s1 and second section is s2 (Logical operator OR ( &amp;&amp; )
$.store.books[?(@.sections[0]=='s1' &amp;&amp; @.sections[1]=='s2' )]

// Find all books where the publication day is before 2000-01-01
$.store.books[?(@.publicationDay &lt; '2000-01-01')]</pre>
<h2>JSON Path &#8211; Using Regular Expressions (Regex)</h2>
<p>The new version of SSIS PowerPack and ODBC PowerPack Supports Regular expressions in the path. Learn more about Regular expressions <a href="https://zappysys.com/blog/using-regular-expressions-in-ssis/" target="_blank" rel="noopener">check this article</a></p><pre class="crayon-plain-tag">//Using Regular Expression: get all books where author attribute contains 'Nigel' or 'Waugh'
//Learn more about regular expressions here : https://zappysys.com/blog/using-regular-expressions-in-ssis/
$.store.books[?(@author=~ /Nigel|Waugh/  )] 

//Using Regular Expression: get all books where category is 'reference' OR author attribute contains 'Nigel' or 'Waugh'
$.store.books[?(@category=='reference' || @author=~ /Nigel|Waugh/ )] 

//Using Regular Expression: get all books where category is 'reference' AND author attribute contains 'Nigel' or 'Waugh'
$.store.books[?(@category=='reference' &amp;&amp; @author=~ /Nigel|Waugh/ )] 

//Using Regular Expression: get all books where author name either start with 'Nigel' (see ^ prefix) or ends with 'Waugh' (see $ suffix)
//Learn more about regular expressions here : https://zappysys.com/blog/using-regular-expressions-in-ssis/
$.store.books[?(@author=~ /^Nigel|Waugh$/  )] 

//Using Regular Expression: get all books where author name starts with 'Nigel'
//Learn more about regular expressions here : https://zappysys.com/blog/using-regular-expressions-in-ssis/
$.store.books[?(@author=~ /^Nigel/  )] 

//Using Regular Expression: get all books where author name ends with 'Waugh'
//Learn more about regular expressions here : https://zappysys.com/blog/using-regular-expressions-in-ssis/
$.store.books[?(@author=~ /Waugh$/  )]</pre><p>
<h2>JSON Path &#8211; Nested Scan for any level (double dots)</h2>
<p>Now lets look at example of below JSON. Assume that you like to extract information from all nested &#8220;<strong>children</strong>&#8221;  nodes (basically extract id and name of every child from any level).</p>
<p>You can use double dots without specifying parent heirarchy like below to scan recusrsivly.</p>
<pre class="crayon-plain-tag">$..children[*]</pre>
<div>
<pre class="crayon-plain-tag">{
  "children": [
    {
      "id": 1,
      "name": "c1",
      "children": [
        {
          "id": 2,
          "name": "c2",
          "children": [
            {
              "id": 3,
              "name": "c3",
              "children": [
                { "id": 4, "name": "c4" },
                { "id": 5, "name": "c5" }
              ]
            }
          ]
        }
      ]
    }
  ]
}</pre>
</div>
<p>For this you can write following JSON Path</p>
<pre class="crayon-plain-tag">$..children[*]</pre>
<p>OR (below to find all children where name is c1 or c2 or c3)</p>
<pre class="crayon-plain-tag">$..children[?(@name=~ /c1|c2|c3/ )]</pre>
<p>Here is an example of a JSON Driver in ODBC. The same expression can be used in SSIS too.</p>
<div id="attachment_11483" style="width: 835px" class="wp-caption alignleft"><a href="https://zappysys.com/blog/wp-content/uploads/2015/10/JSON-ODBC-example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11483" class="wp-image-11483 size-full" src="https://zappysys.com/blog/wp-content/uploads/2015/10/JSON-ODBC-example.png" alt="ODBC JSON Driver - Using Filter with Regular Expressions / JSONPath" width="825" height="784" srcset="https://zappysys.com/blog/wp-content/uploads/2015/10/JSON-ODBC-example.png 825w, https://zappysys.com/blog/wp-content/uploads/2015/10/JSON-ODBC-example-300x285.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/10/JSON-ODBC-example-768x730.png 768w" sizes="(max-width: 825px) 100vw, 825px" /></a><p id="caption-attachment-11483" class="wp-caption-text">ODBC JSON Driver &#8211; Using Filter with Regular Expressions / JSONPath</p></div>
<h2></h2>
<h2></h2>
<h2></h2>
<h2></h2>
<h2></h2>
<h2></h2>
<h2></h2>
<h2></h2>
<h2></h2>
<h2></h2>
<h2></h2>
<h2></h2>
<h2></h2>
<h2></h2>
<h2></h2>
<h2>JSONPath for Root Objects in Array</h2>
<p>Now lets look at another pattern of JSON where your documents are on the first level rather than under some array property. Root filter only works if you have a version released after Dec-29-2021. Previous version didn&#8217;t support filtering on Root Array.</p>
<p><strong>Example JSON</strong></p><pre class="crayon-plain-tag">[
 { id:1 , color:'red'},
 { id:2 , color:'red'},
 { id:3 , color:'blue'},
 { id:4 , color:'green'}
]</pre><p>
<strong>Example JSON Path Filters</strong></p><pre class="crayon-plain-tag">$.[0]  //Extract first document
$..[?(@color=='red')]   //Recursive scan (any level) - Extract all documents where color=red use 2 dots after $ for filter</pre><p>
<strong>NOTE:</strong> using two dots after $ (e.g. <strong>$..[zzzz]</strong>) invokes nested scan so any level array will return documents, this may not be the acceptable case sometimes but if you want to filter the root array then this is the only way for now in ZappySys.</p>
<p>If you must not allow recursive scan then you can use the following two properties</p>
<p>EnableRawOutputModeSingleRow = true;<br />
RawOutputDataRowTemplate = &#8220;{data: [$1] }&#8221;  &#8211;where [$1] is replaced at runtime with Document Text you like to parse (can be static or URL response)</p>
<p>OR</p>
<p>Use functions in RawOutputDataRowTemplate if needed</p>
<p>RawOutputDataRowTemplate = &#8220;{data: &lt;&lt;[$1],FUN_BASE64DEC&gt;&gt;}&#8221;</p>
<p>The above will wrap around the actual JSON / XML you need to parse so now after this setting you can use JSONPath = $.data[?(@id==1)] to avoid two dots to prevent a recursive scan</p>
<p>The post <a href="https://zappysys.com/blog/jsonpath-examples-expression-cheetsheet/">JSONPath Expression Examples &#8211; JSON Cheatsheet (SSIS / ODBC)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
