<?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>Google Drive Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/tag/google-drive/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/tag/google-drive/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Fri, 26 Sep 2025 13:11:08 +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>Google Drive Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/tag/google-drive/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to download files from Google Drive using SSIS</title>
		<link>https://zappysys.com/blog/download-files-google-drive-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sun, 05 Nov 2023 10:28:32 +0000</pubDate>
				<category><![CDATA[Google API]]></category>
		<category><![CDATA[SSIS API Source]]></category>
		<category><![CDATA[SSIS Components]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[Google APIs]]></category>
		<category><![CDATA[Google Drive]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[SSIS API Destination]]></category>
		<category><![CDATA[SSIS Google Drive Connector]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=10649</guid>

					<description><![CDATA[<p>Introduction In today&#8217;s data-driven world, the ability to seamlessly integrate and transfer files between different platforms is crucial for efficient business operations. If you&#8217;re a user of SQL Server Integration Services (SSIS) and looking to integrate Google Drive into your data workflow, you&#8217;re in luck. ZappySys SSIS PowerPack offers a powerful Google Drive Connector that [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/download-files-google-drive-using-ssis/">How to download files from Google Drive using 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/2023/11/google_drive_logo.png"><img loading="lazy" decoding="async" class="alignleft wp-image-11097" src="https://zappysys.com/blog/wp-content/uploads/2023/11/google_drive_logo-150x150.png" alt="" width="106" height="100" srcset="https://zappysys.com/blog/wp-content/uploads/2023/11/google_drive_logo-300x284.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/11/google_drive_logo-768x727.png 768w, https://zappysys.com/blog/wp-content/uploads/2023/11/google_drive_logo.png 980w" sizes="(max-width: 106px) 100vw, 106px" /></a>In today&#8217;s data-driven world, the ability to seamlessly integrate and transfer files between different platforms is crucial for efficient business operations. If you&#8217;re a user of SQL Server Integration Services (SSIS) and looking to integrate Google Drive into your data workflow, you&#8217;re in luck. ZappySys SSIS PowerPack offers a powerful <a href="https://zappysys.com/api/integration-hub/google-drive-connector/">Google Drive Connector</a> that makes downloading files from Google Drive a breeze. In this guide, we&#8217;ll walk you through the process of downloading files from Google Drive using SSIS and the <a href="https://zappysys.com/api/integration-hub/google-drive-connector/ssis">ZappySys SSIS PowerPack Google Drive Connector</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>Download files from Google Drive with SSIS:</h2>
<p>In this section, we will learn how to configure and use Google Drive Connector in the API Source &amp; API Destination to download files from Google Drive.</p>
<ol>
<li>Begin with opening Visual Studio and Creating a New Project.</li>
<li>Select Integration Service Project and in the new project window set the appropriate name and location for the project. Click OK.</li>
<li>In the new SSIS project screen you will find the following:
<ol style="list-style-type: lower-alpha;">
<li>SSIS ToolBox on the left sidebar</li>
<li>Solution Explorer and Property Window on the right bar</li>
<li>Control flow, data flow, event Handlers, Package Explorer in tab windows</li>
<li>Connection Manager Window at the bottom</li>
</ol>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox.png">-`<img loading="lazy" decoding="async" class="alignnone wp-image-10258" src="https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox-1024x653.png" alt="zappysys ssis project with toolbox" width="700" height="447" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox-1024x653.png 1024w, https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox-300x191.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox-768x490.png 768w, https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox.png 1287w" sizes="(max-width: 700px) 100vw, 700px" /></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>: If you don&#8217;t see ZappySys SSIS PowerPack Task or Components in the SSIS Toolbox, please refer to <a href="https://zappysys.zendesk.com/hc/en-us/articles/115004935754-I-don-t-see-PowerPack-components-in-SSIS-Toolbox">this help link</a>.</div></div></li>
<li>Now, Drag and Drop the SSIS Data Flow Task from the SSIS Toolbox. Double-click on the Data Flow Task to see the Data Flow Designer.<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/08/drag-and-drop-data-flow-task.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10260" src="https://zappysys.com/blog/wp-content/uploads/2023/08/drag-and-drop-data-flow-task.png" alt="" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/drag-and-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2023/08/drag-and-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /></a></li>
<li>From the SSIS toolbox drag and drop API Source (Predefined Templates) on the data flow designer surface, and double-click on it to edit it:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10262" src="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg" alt="" width="659" height="292" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg 659w, https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop-300x133.jpg 300w" sizes="(max-width: 659px) 100vw, 659px" /></a></li>
<li>Select <strong>New Connection</strong> to create a new connection:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-new-connection.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10263" src="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-new-connection.png" alt="" width="684" height="643" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-new-connection.png 684w, https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-new-connection-300x282.png 300w" sizes="(max-width: 684px) 100vw, 684px" /></a></li>
</ol>
<h2>Configuring the Google Drive Connector</h2>
<ol>
<li>Use a preinstalled Google Drive Connector from the Popular Connector List or press the Search Online radio button to download Google Drive Connector. Once downloaded simply use it in the configuration:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-template-selection-googledrive-walkthrough.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10354" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-template-selection-googledrive-walkthrough.png" alt="ssis googledrive template selection walkthrough" width="781" height="686" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-template-selection-googledrive-walkthrough.png 781w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-template-selection-googledrive-walkthrough-300x264.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-template-selection-googledrive-walkthrough-768x675.png 768w" sizes="(max-width: 781px) 100vw, 781px" /></a></li>
<li>Proceed with selecting the desired Authentication Type. Then select API Base URL (in most cases default one is the right one). Finally, fill in all the required parameters and set optional parameters if needed.</li>
<li>After configuring all the required properties in the API Connection Manager, please click on the &#8220;Test Connection&#8221; button to confirm that the connection is established successfully.<br />
<h3>Method1: Connect to Google Drive using User Account [OAuth]</h3>
<p>You may press a link <a href="https://zappysys.com/api/integration-hub/google-drive-connector/help/authentication/OAuth"><strong>Steps to Configure</strong></a> which will help set certain parameters.</p>
<div id="attachment_10355" style="width: 876px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-generate-token.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10355" class="size-full wp-image-10355" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-generate-token.png" alt="SSIS API Source - Generate Token - Google Drive with User Account" width="866" height="773" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-generate-token.png 866w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-generate-token-300x268.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-generate-token-768x686.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></a><p id="caption-attachment-10355" class="wp-caption-text">SSIS API Source &#8211; Generate Token &#8211; Google Drive with User Account</p></div>
<h3>Method2: Connect to Google Drive using Service Account [OAuth]</h3>
<p>You may press a link <a href="https://zappysys.com/api/integration-hub/google-drive-connector/help/authentication/ServiceAccount"><strong>Steps to Configure</strong></a> which will help set certain parameters.</p>
<div id="attachment_10353" style="width: 876px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-serviceaccount-generate-token.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10353" class="size-full wp-image-10353" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-serviceaccount-generate-token.png" alt="SSIS API Source - Generate Token - Google Drive with Service Account" width="866" height="773" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-serviceaccount-generate-token.png 866w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-serviceaccount-generate-token-300x268.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-serviceaccount-generate-token-768x686.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></a><p id="caption-attachment-10353" class="wp-caption-text">SSIS API Source &#8211; Generate Token &#8211; Google Drive with Service Account</p></div></li>
</ol>
<h2>How to download a single file from Google Drive</h2>
<p>In the API Source Component, we&#8217;ve chosen the API Connection Manager. Next, we need to configure the remaining properties of the component to download the single file from Google Drive.</p>
<ol>
<li>Choose the <strong>Download a file</strong> endpoint from the &#8220;Select Table/Endpoint&#8221; dropdown menu.</li>
<li>To access detailed API documentation for downloading files, you can click on the following link: <a href="https://developers.google.com/drive/api/reference/rest/v3/files/get"><strong>Help for: Download a File</strong></a>.</li>
<li>Please choose a File ID from the drop-down menu to indicate which file you wish to download. This is an essential parameter for the download process.</li>
<li>Please indicate the desired filename for the file being downloaded by setting the <strong>FileName</strong> parameter.</li>
<li>If you intend to replace the local file with the one being downloaded, please select the &#8216;<strong>AlwaysOverwrite</strong>&#8216; option from the dropdown menu labeled &#8216;<strong>FileOverwriteMode</strong>&#8216;. Alternatively, you can choose &#8216;FileIfExists&#8217; or &#8216;SkipIfExists&#8217; based on your specific needs.</li>
</ol>
<p>Please refer to the sample screenshot below.</p>
<div id="attachment_10690" style="width: 896px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-api-source-googledrive-single-file-download.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10690" class="wp-image-10690 size-full" src="https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-api-source-googledrive-single-file-download.png" alt="SSIS API Source - Google Drive - Download Single File" width="886" height="603" srcset="https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-api-source-googledrive-single-file-download.png 886w, https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-api-source-googledrive-single-file-download-300x204.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-api-source-googledrive-single-file-download-768x523.png 768w" sizes="(max-width: 886px) 100vw, 886px" /></a><p id="caption-attachment-10690" class="wp-caption-text">SSIS API Source &#8211; Google Drive &#8211; Download Single File</p></div>
<p>Once you have configured all the mentioned properties above, please click on the &#8220;Preview Data&#8221; button to initiate the API call. With just a few clicks, we have successfully configured the call to Google Drive using the <strong>ZappySys Google Drive Connector</strong> for downloading a Single file from Google Drive.</p>
<h2>How to download multiple files from Google Drive</h2>
<p>In the API Destination Component, we have chosen the API Connection Manager. Now, we must proceed to configure the remaining properties of the component to facilitate the download of multiple files from Google Drive. Additionally, we should make use of an OLE DB Source and Derived Column component to map the files for the download process.</p>
<ol>
<li>Drag and drop the OLE DB Source Component from the SSIS Toolbox. Double-click on the OLE DB Source Component to initiate its configuration.
<div id="attachment_7289" style="width: 515px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/oledb-source-drag-and-drop.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7289" class="wp-image-7289 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/06/oledb-source-drag-and-drop.png" alt="OLE DB Source - Drag and Drop" width="505" height="190" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/oledb-source-drag-and-drop.png 505w, https://zappysys.com/blog/wp-content/uploads/2019/06/oledb-source-drag-and-drop-300x113.png 300w" sizes="(max-width: 505px) 100vw, 505px" /></a><p id="caption-attachment-7289" class="wp-caption-text">OLE DB Source &#8211; Drag and Drop</p></div></li>
<li>Create a new OLE DB Connection Manager and configure your SQL Server settings for the connection. Next, select the Data access mode, specify the name of the table or view, or write an SQL Command. Afterward, click on the &#8216;Preview&#8217; button to view a preview and check the &#8216;Columns&#8217; tab for the source columns.
<div id="attachment_10693" style="width: 835px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-oledb-source-read-googledrive-filesdata-sql.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10693" class="size-full wp-image-10693" src="https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-oledb-source-read-googledrive-filesdata-sql.png" alt="SSIS OLE DB Source - Configure SQL Connection and fetch the table data" width="825" height="717" srcset="https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-oledb-source-read-googledrive-filesdata-sql.png 825w, https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-oledb-source-read-googledrive-filesdata-sql-300x261.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-oledb-source-read-googledrive-filesdata-sql-768x667.png 768w" sizes="(max-width: 825px) 100vw, 825px" /></a><p id="caption-attachment-10693" class="wp-caption-text">SSIS OLE DB Source &#8211; Configure SQL Connection and fetch the table data</p></div></li>
<li>Next, drag and drop the Derived Column Component from the SSIS Toolbox. Double-click on the Derived Column Component to begin its configuration.
<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>Now, add a new Derived Column by setting the expression to concatenate FilePath and FileName. Click &#8216;OK&#8217; to save the configuration.
<div id="attachment_10695" style="width: 869px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-derived-column-add-newcolumn-set-expression.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10695" class="wp-image-10695 size-full" src="https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-derived-column-add-newcolumn-set-expression.png" alt="SSIS Derived Column - Add New Column &amp; Set Expression" width="859" height="622" srcset="https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-derived-column-add-newcolumn-set-expression.png 859w, https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-derived-column-add-newcolumn-set-expression-300x217.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-derived-column-add-newcolumn-set-expression-768x556.png 768w" sizes="(max-width: 859px) 100vw, 859px" /></a><p id="caption-attachment-10695" class="wp-caption-text">SSIS Derived Column &#8211; Add New Column &amp; Set Expression</p></div></li>
<li>Now, drag and drop the API Destination Component from the SSIS Toolbox. Double-click on the API Destination Component to begin its configuration.
<div id="attachment_10697" style="width: 879px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-api-destination-drag-and-drop.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10697" class="wp-image-10697 size-full" src="https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-api-destination-drag-and-drop.png" alt="Drag and Drop the SSIS API Destination Component" width="869" height="548" srcset="https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-api-destination-drag-and-drop.png 869w, https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-api-destination-drag-and-drop-300x189.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-api-destination-drag-and-drop-768x484.png 768w" sizes="(max-width: 869px) 100vw, 869px" /></a><p id="caption-attachment-10697" class="wp-caption-text">Drag and Drop the SSIS API Destination Component</p></div></li>
<li>Double-click on the <strong>API Destination</strong> component to configure it for uploading multiple files to Google Drive.
<ol style="list-style-type: lower-alpha;">
<li>Choose the <strong>Download a file</strong> endpoint from the &#8220;Select Table/Endpoint&#8221; dropdown menu.</li>
<li>To access detailed API documentation for downloading files, you can click on the following link: <a href="https://developers.google.com/drive/api/reference/rest/v3/files/get"><strong>Help for: Download File</strong></a>.</li>
<li>Please specify the &#8216;FileOverwriteMode&#8217; option as &#8216;AlwaysOverwrite,&#8217; or you can choose &#8216;FailIfExists&#8217; or &#8216;SkipIfExists&#8217; options based on your requirements.<br />
Please refer to the sample screenshot below.</p>
<div id="attachment_10700" style="width: 816px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-api-destination-configure-settingstab-download-multiplefile.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10700" class="wp-image-10700 size-full" src="https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-api-destination-configure-settingstab-download-multiplefile.png" alt="SSIS API Destination Component - Configure Settings Tab" width="806" height="669" srcset="https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-api-destination-configure-settingstab-download-multiplefile.png 806w, https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-api-destination-configure-settingstab-download-multiplefile-300x249.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-api-destination-configure-settingstab-download-multiplefile-768x637.png 768w" sizes="(max-width: 806px) 100vw, 806px" /></a><p id="caption-attachment-10700" class="wp-caption-text">SSIS API Destination Component &#8211; Configure Settings Tab</p></div></li>
<li>Now, go to the Mappings tab and specify the source columns with the corresponding target properties.<br />
Note: Here We&#8217;re mapping FileID with $$Id and FileNameWithPath with $$ResponseDataFile. You can create mappings based on your Source columns<br />
Please refer to the sample screenshot below</p>
<div id="attachment_10699" style="width: 646px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-api-destination-configure-mappingstab-download-multiplefile.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10699" class="wp-image-10699 size-full" src="https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-api-destination-configure-mappingstab-download-multiplefile.png" alt="SSIS API Destination Component - Configure Mappings Tab" width="636" height="442" srcset="https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-api-destination-configure-mappingstab-download-multiplefile.png 636w, https://zappysys.com/blog/wp-content/uploads/2023/10/ssis-api-destination-configure-mappingstab-download-multiplefile-300x208.png 300w" sizes="(max-width: 636px) 100vw, 636px" /></a><p id="caption-attachment-10699" class="wp-caption-text">SSIS API Destination Component &#8211; Configure Mappings Tab</p></div></li>
</ol>
</li>
<li>Once you have configured all the mentioned properties above, please click on the &#8220;Preview Data&#8221; button from the Settings tab to initiate the API call. With just a few clicks, we have successfully configured the call to Google Drive using the ZappySys Google Drive Connector for downloading multiple files from Google Drive.<br />
Please refer to the sample screenshot below.</p>
<div id="attachment_10705" style="width: 1191px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/11/ssis-api-destination-download-multiplefiles-success.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10705" class="size-full wp-image-10705" src="https://zappysys.com/blog/wp-content/uploads/2023/11/ssis-api-destination-download-multiplefiles-success.png" alt="Download Multiple files from Google Drive" width="1181" height="381" srcset="https://zappysys.com/blog/wp-content/uploads/2023/11/ssis-api-destination-download-multiplefiles-success.png 1181w, https://zappysys.com/blog/wp-content/uploads/2023/11/ssis-api-destination-download-multiplefiles-success-300x97.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/11/ssis-api-destination-download-multiplefiles-success-768x248.png 768w, https://zappysys.com/blog/wp-content/uploads/2023/11/ssis-api-destination-download-multiplefiles-success-1024x330.png 1024w" sizes="(max-width: 1181px) 100vw, 1181px" /></a><p id="caption-attachment-10705" class="wp-caption-text">Download Multiple files from Google Drive</p></div></li>
</ol>
<h2>Conclusion</h2>
<p>In this blog, we learned how to connect with Google Drive using SSIS API Connection Manager and download single or multiple files from Google Drive using a combination of SSIS components, including the <a href="https://zappysys.com/products/ssis-powerpack/ssis-api-source/">SSIS API Source component</a>, <a href="https://zappysys.com/products/ssis-powerpack/ssis-api-destination/">SSIS API Destination component</a>, OLE DB Source component, and Derived Column component.</p>
<p>The post <a href="https://zappysys.com/blog/download-files-google-drive-using-ssis/">How to download files from Google Drive using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to upload files on Google Drive using SSIS</title>
		<link>https://zappysys.com/blog/upload-files-google-drive-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Thu, 07 Sep 2023 12:18:50 +0000</pubDate>
				<category><![CDATA[Google API]]></category>
		<category><![CDATA[SSIS API Source]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[Foreach Loop Container]]></category>
		<category><![CDATA[google api]]></category>
		<category><![CDATA[Google Drive]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[ssis advanced file system task]]></category>
		<category><![CDATA[upload files]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=10255</guid>

					<description><![CDATA[<p>Introduction In today&#8217;s data-driven world, the ability to seamlessly integrate and transfer files between different platforms is crucial for efficient business operations. If you&#8217;re a user of SQL Server Integration Services (SSIS) and looking to integrate Google Drive into your data workflow, you&#8217;re in luck. ZappySys SSIS PowerPack offers a powerful Google Drive Connector that [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/upload-files-google-drive-using-ssis/">How to upload files on Google Drive using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><strong>Introduction</strong></h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2023/11/google_drive_logo.png"><img loading="lazy" decoding="async" class="alignleft wp-image-11097" src="https://zappysys.com/blog/wp-content/uploads/2023/11/google_drive_logo-300x284.png" alt="" width="106" height="100" srcset="https://zappysys.com/blog/wp-content/uploads/2023/11/google_drive_logo-300x284.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/11/google_drive_logo-768x727.png 768w, https://zappysys.com/blog/wp-content/uploads/2023/11/google_drive_logo.png 980w" sizes="(max-width: 106px) 100vw, 106px" /></a>In today&#8217;s data-driven world, the ability to seamlessly integrate and transfer files between different platforms is crucial for efficient business operations. If you&#8217;re a user of SQL Server Integration Services (SSIS) and looking to integrate Google Drive into your data workflow, you&#8217;re in luck. ZappySys SSIS PowerPack offers a powerful <a href="https://zappysys.com/api/integration-hub/google-drive-connector/">Google Drive Connector</a> that makes uploading files to Google Drive a breeze. In this guide, we&#8217;ll walk you through the process of uploading files to Google Drive using SSIS and the <a href="https://zappysys.com/api/integration-hub/google-drive-connector/ssis">ZappySys SSIS PowerPack Google Drive Connector</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>Upload files to Google Drive with SSIS:</h2>
<p>In this section, we will learn how to configure and use Google Drive Connector in the API Source to upload files on Google Drive.</p>
<ol>
<li>Begin with opening Visual Studio and Creating a New Project.</li>
<li>Select Integration Service Project and in the new project window set the appropriate name and location for the project. Click OK.</li>
<li>In the new SSIS project screen you will find the following:
<ol style="list-style-type: lower-alpha;">
<li>SSIS ToolBox on the left sidebar</li>
<li>Solution Explorer and Property Window on the right bar</li>
<li>Control flow, data flow, event Handlers, Package Explorer in tab windows</li>
<li>Connection Manager Window at the bottom</li>
</ol>
<div id="attachment_10258" style="width: 710px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/upload-files-google-drive-using-ssis/zappysys-ssis-project-with-toolbox/#main"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10258" class="wp-image-10258" src="https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox-1024x653.png" alt="zappysys ssis project with toolbox" width="700" height="447" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox-1024x653.png 1024w, https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox-300x191.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox-768x490.png 768w, https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox.png 1287w" sizes="(max-width: 700px) 100vw, 700px" /></a><p id="caption-attachment-10258" class="wp-caption-text">SSIS Toolbox &#8211; ZappySys Tasks</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>: If you don&#8217;t see ZappySys SSIS PowerPack Task or Components in the SSIS Toolbox, please refer to <a href="https://zappysys.zendesk.com/hc/en-us/articles/115004935754-I-don-t-see-PowerPack-components-in-SSIS-Toolbox">this help link</a>.</div></div></li>
<li>Now, Drag and Drop the SSIS Data Flow Task from the SSIS Toolbox. Double-click on the Data Flow Task to see the Data Flow Designer.<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/08/drag-and-drop-data-flow-task.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10260" src="https://zappysys.com/blog/wp-content/uploads/2023/08/drag-and-drop-data-flow-task.png" alt="" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/drag-and-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2023/08/drag-and-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /></a></li>
<li>From the SSIS toolbox drag and drop API Source (Predefined Templates) on the data flow designer surface, and double-click on it to edit it:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10262" src="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg" alt="" width="659" height="292" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg 659w, https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop-300x133.jpg 300w" sizes="(max-width: 659px) 100vw, 659px" /></a></li>
<li>Select <strong>New Connection</strong> to create a new connection:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-new-connection.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10263" src="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-new-connection.png" alt="" width="684" height="643" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-new-connection.png 684w, https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-new-connection-300x282.png 300w" sizes="(max-width: 684px) 100vw, 684px" /></a></li>
</ol>
<h2>Configuring the Google Drive Connector</h2>
<ol>
<li>Use a preinstalled Google Drive Connector from the Popular Connector List or press the Search Online radio button to download Google Drive Connector. Once downloaded simply use it in the configuration:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-template-selection-googledrive-walkthrough.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10354" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-template-selection-googledrive-walkthrough.png" alt="ssis googledrive template selection walkthrough" width="781" height="686" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-template-selection-googledrive-walkthrough.png 781w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-template-selection-googledrive-walkthrough-300x264.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-template-selection-googledrive-walkthrough-768x675.png 768w" sizes="(max-width: 781px) 100vw, 781px" /></a></li>
<li>Proceed with selecting the desired Authentication Type. Then select API Base URL (in most cases default one is the right one). Finally, fill in all the required parameters and set optional parameters if needed.</li>
<li>After configuring all the required properties in the API Connection Manager, please click on the &#8220;Test Connection&#8221; button to confirm that the connection is established successfully.<br />
<h3>Method1: Connect to Google Drive using User Account [OAuth]</h3>
<p>You may press a link <a href="https://zappysys.com/api/integration-hub/google-drive-connector/help/authentication/OAuth"><strong>Steps to Configure</strong></a> which will help set certain parameters.</p>
<div id="attachment_10355" style="width: 876px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-generate-token.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10355" class="size-full wp-image-10355" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-generate-token.png" alt="SSIS API Source - Generate Token - Google Drive with User Account" width="866" height="773" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-generate-token.png 866w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-generate-token-300x268.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-generate-token-768x686.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></a><p id="caption-attachment-10355" class="wp-caption-text">SSIS API Source &#8211; Generate Token &#8211; Google Drive with User Account</p></div>
<h3>Method2: Connect to Google Drive using Service Account [OAuth]</h3>
<p>You may press a link <a href="https://zappysys.com/api/integration-hub/google-drive-connector/help/authentication/ServiceAccount"><strong>Steps to Configure</strong></a> which will help set certain parameters.</p>
<div id="attachment_10353" style="width: 876px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-serviceaccount-generate-token.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10353" class="size-full wp-image-10353" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-serviceaccount-generate-token.png" alt="SSIS API Source - Generate Token - Google Drive with Service Account" width="866" height="773" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-serviceaccount-generate-token.png 866w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-serviceaccount-generate-token-300x268.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-serviceaccount-generate-token-768x686.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></a><p id="caption-attachment-10353" class="wp-caption-text">SSIS API Source &#8211; Generate Token &#8211; Google Drive with Service Account</p></div></li>
</ol>
<h2>How to upload a local file to Google Drive</h2>
<p>In the API Source Component, we&#8217;ve chosen the API Connection Manager. Next, we need to configure the remaining properties of the component to upload a local file to Google Drive.</p>
<ol>
<li>Choose the <strong>Upload a file</strong> endpoint from the &#8220;Select Table/Endpoint&#8221; dropdown menu.</li>
<li>To access detailed API documentation for uploading files, you can click on the following link: <a href="https://developers.google.com/drive/api/reference/rest/v3/files/create"><strong>Help for: Upload File</strong></a>.</li>
<li>Please specify the desired filename for the uploaded file by setting the <strong>FileName</strong> parameter.</li>
<li>Specify the desired local file path by setting the <strong>DiskFilePath</strong> parameter.</li>
<li>If you wish to upload the local file to a specific folder in Google Drive, please choose the folder ID from the dropdown menu labeled <strong>ParentFolderId</strong>. Otherwise, you can skip this parameter as it&#8217;s optional.</li>
</ol>
<p>Please refer to the sample screenshot below.</p>
<div id="attachment_10357" style="width: 896px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-single-file-upload.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10357" class="size-full wp-image-10357" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-single-file-upload.png" alt="SSIS API Source - Google Drive - Upload Single File" width="886" height="603" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-single-file-upload.png 886w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-single-file-upload-300x204.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-single-file-upload-768x523.png 768w" sizes="(max-width: 886px) 100vw, 886px" /></a><p id="caption-attachment-10357" class="wp-caption-text">SSIS API Source &#8211; Google Drive &#8211; Upload Single File</p></div>
<p>Once you have configured all the mentioned properties above, please click on the &#8220;Preview Data&#8221; button to initiate the API call. With just a few clicks, we have successfully configured the call to Google Drive using the <strong>ZappySys Google Drive Connector</strong> for uploading a local file to Google Drive.</p>
<h2>How to upload multiple files to Google Drive</h2>
<p>In the API Source Component, we&#8217;ve selected the API Connection Manager. Next, we need to configure the remaining properties of the component to upload multiple files to Google Drive. Additionally, we should utilize a Foreach Loop Container to iterate through each file one by one in a loop.</p>
<ol>
<li>Create 3 SSIS variables as described below.<br />
<table border="1">
<tbody>
<tr>
<th>Variable Name</th>
<th>Datatype</th>
<th>Value</th>
</tr>
<tr>
<td>varFileLists</td>
<td>Object</td>
<td>System.Object</td>
</tr>
<tr>
<td>varFileName</td>
<td>String</td>
<td>fake.extension</td>
</tr>
<tr>
<td>varFullFilePath</td>
<td>String</td>
<td>C:/fake/fake.extension</td>
</tr>
</tbody>
</table>
</li>
<li>Go to Control Flow, From the SSIS toolbox drag and drop <strong>ZS Advanced File System Task</strong> on the control flow designer surface, and double click on it to edit it:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-drag-and-drop.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10363" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-drag-and-drop.png" alt="SSIS Advanced File System Task - Drag &amp; Drop" width="580" height="241" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-drag-and-drop.png 580w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-drag-and-drop-300x125.png 300w" sizes="(max-width: 580px) 100vw, 580px" /></a></li>
<li>Select the &#8220;Get file list as ADO.NET Data Table&#8221; action from the Action drop-down menu. Set the file path in the Path textbox. Choose the variable (Object type) where you want to store the file list, and then click the OK button to save the settings.
<div id="attachment_10364" style="width: 722px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-store-filelists-adotable-in-object-variable.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10364" class="size-full wp-image-10364" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-store-filelists-adotable-in-object-variable.png" alt="SSIS Advanced File System Task - Get file list as ADO.net Data Table" width="712" height="623" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-store-filelists-adotable-in-object-variable.png 712w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-store-filelists-adotable-in-object-variable-300x263.png 300w" sizes="(max-width: 712px) 100vw, 712px" /></a><p id="caption-attachment-10364" class="wp-caption-text">SSIS Advanced File System Task &#8211; Get file list as ADO.net Data Table</p></div></li>
<li>Now, drag and drop the &#8220;Foreach Loop Container&#8221; from the SSIS Toolbox and connect it with the &#8220;ZS Advanced File System Task.&#8221; Double-click on the &#8220;Foreach Loop Container&#8221; to edit its properties.
<div id="attachment_10365" style="width: 750px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-foreach-loop-container-drag-and-drop-googledrive.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10365" class="size-full wp-image-10365" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-foreach-loop-container-drag-and-drop-googledrive.png" alt="SSIS Foreach Loop Container - Drag &amp; Drop" width="740" height="531" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-foreach-loop-container-drag-and-drop-googledrive.png 740w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-foreach-loop-container-drag-and-drop-googledrive-300x215.png 300w" sizes="(max-width: 740px) 100vw, 740px" /></a><p id="caption-attachment-10365" class="wp-caption-text">SSIS Foreach Loop Container &#8211; Drag &amp; Drop</p></div></li>
<li>In the Foreach Loop Editor&#8217;s &#8220;Collection&#8221; tab, choose the Enumerator as &#8220;Foreach ADO Enumerator.&#8221; In the &#8220;ADO object source variable&#8221; field, select your SSIS object-typed variable. Select the &#8220;Rows in the first table&#8221; radio option.
<div id="attachment_10371" style="width: 747px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-collection-tab-configuration.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10371" class="size-full wp-image-10371" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-collection-tab-configuration.png" alt="SSIS Foreach Loop Editor - Collection - Select Variable &amp; Enumeration mode" width="737" height="631" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-collection-tab-configuration.png 737w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-collection-tab-configuration-300x257.png 300w" sizes="(max-width: 737px) 100vw, 737px" /></a><p id="caption-attachment-10371" class="wp-caption-text">SSIS Foreach Loop Editor &#8211; Collection &#8211; Select Variable &amp; Enumeration mode</p></div></li>
<li>In the Foreach Loop Editor&#8217;s &#8220;Variable Mappings&#8221; tab, select the variables that you want to map to the values from the collection, and then click the &#8220;OK&#8221; button to save your selections.
<div id="attachment_10370" style="width: 747px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-variablemappings.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10370" class="size-full wp-image-10370" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-variablemappings.png" alt="SSIS Foreach Loop Editor - Variable Mappings tab" width="737" height="631" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-variablemappings.png 737w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-variablemappings-300x257.png 300w" sizes="(max-width: 737px) 100vw, 737px" /></a><p id="caption-attachment-10370" class="wp-caption-text">SSIS Foreach Loop Editor &#8211; Variable Mappings</p></div></li>
<li>Inside the Foreach Loop Container, drag and drop the Data Flow Task, and then rename it according to your preference.
<div id="attachment_10374" style="width: 716px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-dataflow-task-inside-foreachloop-container-googledrive-multiplefiles-upload.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10374" class="size-full wp-image-10374" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-dataflow-task-inside-foreachloop-container-googledrive-multiplefiles-upload.png" alt="SSIS Data Flow Task - Drag &amp; Drop inside Foreach Loop Container" width="706" height="420" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-dataflow-task-inside-foreachloop-container-googledrive-multiplefiles-upload.png 706w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-dataflow-task-inside-foreachloop-container-googledrive-multiplefiles-upload-300x178.png 300w" sizes="(max-width: 706px) 100vw, 706px" /></a><p id="caption-attachment-10374" class="wp-caption-text">SSIS Data Flow Task &#8211; Drag &amp; Drop inside Foreach Loop Container</p></div></li>
<li>Double-click on the Data Flow Task to see the Data Flow Designer, From the SSIS toolbox drag and drop API Source (Predefined Templates) on the data flow designer surface, and double click on it to edit it:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10262" src="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg" alt="SSIS API Source - Drag &amp; Drop" width="659" height="292" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg 659w, https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop-300x133.jpg 300w" sizes="(max-width: 659px) 100vw, 659px" /></a></li>
<li>Double-click on the <strong>API Source</strong> component to configure it for uploading multiple files to Google Drive.
<ol style="list-style-type: lower-alpha;">
<li>Choose the <strong>Upload a file</strong> endpoint from the &#8220;Select Table/Endpoint&#8221; dropdown menu.</li>
<li>To access detailed API documentation for uploading files, you can click on the following link: <a href="https://developers.google.com/drive/api/reference/rest/v3/files/create"><strong>Help for: Upload File</strong></a>.</li>
<li>Please specify the desired SSIS Variable [varFileName] which contains file name for the uploaded file by setting the <strong>FileName</strong> parameter.</li>
<li>To specify the desired local SSIS variable [varFullFilePath], which holds the file path, set the <strong>DiskFilePath</strong> parameter.<br />
When configuring the SSIS variable directly in the Raw Edit, JSON may become invalid due to the requirement of slashes within the local file path. To address this, we use a JSONENC Placeholder Function for proper escaping.<br />
<pre class="crayon-plain-tag">&lt;&lt;{{User::varUserFullFilePath}},FUN_JSONENC&gt;&gt;</pre></li>
<li>If you wish to upload the local file to a specific folder in Google Drive, please choose the folder ID from the dropdown menu labeled <strong>ParentFolderId</strong>. Otherwise, you can skip this parameter as it&#8217;s optional.</li>
</ol>
<p>Please refer to the sample screenshot below.</p>
<div id="attachment_10369" style="width: 896px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-multiple-files-upload.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10369" class="size-full wp-image-10369" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-multiple-files-upload.png" alt="SSIS API Source - Google Drive - Upload Multiple files - configuration" width="886" height="603" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-multiple-files-upload.png 886w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-multiple-files-upload-300x204.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-multiple-files-upload-768x523.png 768w" sizes="(max-width: 886px) 100vw, 886px" /></a><p id="caption-attachment-10369" class="wp-caption-text">SSIS API Source &#8211; Google Drive &#8211; Upload Multiple files configuration</p></div>
<p>To configure dynamic filenames and file paths, you can set variables. Click on &#8220;Raw Edit,&#8221; and in the &#8220;Edit Parameters&#8221; popup, you can use SSIS variables, as shown in the image below.</p>
<p>Once you have configured all the mentioned properties above, please click on the &#8220;Preview Data&#8221; button to initiate the API call. With just a few clicks, we have successfully configured the call to Google Drive using the <strong>ZappySys Google Drive Connector</strong> for uploading multiple files to Google Drive.</li>
</ol>
<h2>Conclusion</h2>
<p>In this blog, we learned how to connect with Google Drive using SSIS API Connection Manager and upload single or multiple files to Google Drive using a combination of SSIS components, including the <a href="https://zappysys.com/products/ssis-powerpack/ssis-api-source/">SSIS API Source component</a>, <a href="https://zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/">SSIS ZS Advanced File System Task</a>, Foreach Loop Container, and SSIS variables.</p>
<p>The post <a href="https://zappysys.com/blog/upload-files-google-drive-using-ssis/">How to upload files on Google Drive using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to read / write Google SpreadSheet using SSIS</title>
		<link>https://zappysys.com/blog/get-data-google-spreadsheet-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 24 Sep 2016 23:21:11 +0000</pubDate>
				<category><![CDATA[Google API]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS REST API Task]]></category>
		<category><![CDATA[API Integration]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google api]]></category>
		<category><![CDATA[Google Drive]]></category>
		<category><![CDATA[Google Spreadsheet]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[oauth2]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[ssis rest api task]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=798</guid>

					<description><![CDATA[<p>Introduction In this post you will learn how to get data from Google SpreadSheet (REST API) using SSIS. We will use drag and drop REST API connectors from SSIS PowerPack. No need to download any SDK or learn programming language (e.g. JAVA, C#, Ruby, Python) when you use SSIS PowerPack Connectors. We will use Google [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/get-data-google-spreadsheet-using-ssis/">How to read / write Google SpreadSheet using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<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;"><strong>UPDATE:</strong> ZappySys has released a brand new <a href="https://zappysys.com/api/integration-hub/google-sheets-connector/">API Connector for Google Sheets Online</a> which makes it much simpler to <strong>Read/Write Google Sheets Data in SSIS</strong> compared to the steps listed in this article. You can still use steps from this article but if you are new to API or want to avoid learning curve with API then use newer approach.</p>
<p>Please visit <a href="https://zappysys.com/api/integration-hub/">this page to see all</a> Pre-Configured ready to use API connectors which you can use in <a href="https://zappysys.com/products/ssis-powerpack/ssis-api-source/">SSIS API Source</a> / <a href="https://zappysys.com/products/ssis-powerpack/ssis-api-destination/">SSIS API Destination</a> OR <a href="https://zappysys.com/products/odbc-powerpack/odbc-api-driver/">API ODBC Driver</a> (for non-SSIS Apps such as Excel, Power BI, Informatica).</p>
</div></div>
<a href="//zappysys.com/blog/wp-content/uploads/2016/09/google-sheets-api-integration.png"><img loading="lazy" decoding="async" class="alignleft wp-image-1670" src="//zappysys.com/blog/wp-content/uploads/2016/09/google-sheets-api-integration.png" alt="" width="150" height="171" srcset="https://zappysys.com/blog/wp-content/uploads/2016/09/google-sheets-api-integration.png 350w, https://zappysys.com/blog/wp-content/uploads/2016/09/google-sheets-api-integration-263x300.png 263w" sizes="(max-width: 150px) 100vw, 150px" /></a>In this post you will learn how to <em>get data from Google SpreadSheet</em> (REST API) using SSIS. We will use drag and drop REST API connectors from <a href="//zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a>. No need to download any SDK or learn programming language (e.g. JAVA, C#, Ruby, Python) when you use SSIS PowerPack Connectors. We will use Google Drive API and Google Sheets API to get file list and export SpreadSheet as CSV file in few clicks (Using OAuth 2.0 connection in SSIS).</p>
<p>In this tutorial we will use <a href="//zappysys.com/blog/call-rest-api-using-ssis-web-service-task/" target="_blank" rel="noopener">REST API Task</a> to call some ad-hoc API (e.g. get File List from Google Drive) and save output into Variable or File. We will use <a href="//zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-oauth-connection-manager.htm" target="_blank" rel="noopener">OAuth connection</a> along with <a href="//zappysys.com/products/ssis-powerpack/ssis-xml-source/" target="_blank" rel="noopener">ZappySys JSON Source connector</a> to read data from Google SpreadSheet (Use Drive API) and load into SQL Server (Export Google SpreadSheet to CSV).</p>
<h2>Create Google API Project</h2>
<p>First step to access any Google API is create an API Project in Google Console. If you don&#8217;t want to go through this then Skip this Step-1 and in the next section select Default OAuth App option on OAth Connection Manager (This is the most easiest option for now unless you want to use your own OAuth App).</p>
<p><a href="https://zappysys.com/blog/register-google-oauth-application-get-clientid-clientsecret/" target="_blank" rel="noopener">Check this article</a> for step-by-step instructions. When you follow these instructions make sure you enable Google Drive API (In the article it shows how to enable YouTube API as an example but you will need to enable Drive API for this article).</p>
<h2>Create OAuth Connection Manager in SSIS</h2>
<p>Once you create Google API project and obtained Client ID and Client Secret your next step is to create <a href="//zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-oauth-connection-manager.htm" target="_blank" rel="noopener">OAuth Connection Manager</a> in SSIS. ZappySys OAuth connection manager comes with many predefined OAuth Providers (e.g. Facebook, Twitter, Google etc) but you can also define custom OAuth settings for any OAuth enabled API.</p>
<p>To create SSIS OAuth 2.0 Connection for Google API perform following steps.</p>
<ol>
<li>Download and Install SSIS PowerPack</li>
<li>Create new SSIS Package</li>
<li>Right click in Connection Manager Area and Click &#8220;New Connection&#8221;</li>
<li>When prompted select ZS-OAUTH connection type</li>
<li>On the OAuth Connection Manager Select Provider=<strong>Google Sheets + Drive</strong>.</li>
<li>You can keep &#8220;Use Default App&#8221; selected or choose Custom App. <a href="https://zappysys.com/blog/register-google-oauth-application-get-clientid-clientsecret/" target="_blank" rel="noopener">Click here to learn &#8211; how to register Custom Google App</a></li>
<li>If you choose the Custom App option then <strong>enter the below scopes</strong> (or click Select Scopes). If you choose the default app then it&#8217;s not required.
<p>This will allow read / write access to Drive Files or Sheet (E.g. Reading file content / Export file to CSV). You can use Scope browser to see many other available permissions.</p><pre class="crayon-plain-tag">https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.readonly
https://www.googleapis.com/auth/spreadsheets
https://www.googleapis.com/auth/spreadsheets.readonly</pre><p>
Click Generate Token button.</p>
<div id="attachment_847" style="width: 610px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-oauth-connection-google-drive-api-access-file.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-847" class="wp-image-847" src="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-oauth-connection-google-drive-api-access-file.png" alt="SSIS OAuth Connection Manager - Access Google Drive API using OAuth 2.0" width="600" height="351" srcset="https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-oauth-connection-google-drive-api-access-file.png 957w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-oauth-connection-google-drive-api-access-file-300x176.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><p id="caption-attachment-847" class="wp-caption-text">SSIS OAuth Connection Manager &#8211; Access Google Drive API using OAuth 2.0</p></div></li>
<li>You will see UI as below&#8230; Click Accept (You may have to scroll to see that button sometimes)</li>
<li>Click Test to see connection is working.</li>
</ol>
<p><strong>NOTE:</strong> If you don&#8217;t want to use Default OAuth App provided by ZappySys then select &#8220;Use Custom OAuth App&#8221; option (App created in previous section) specify your ClientID, ClientSecret.</p>
<h2>Find Google Sheet ID for API call</h2>
<p>Before we can read or write Sheet data in SSIS we need to know Google Driver File ID. We will use this ID in next few sections.</p>
<p>Easiest way to find File ID is look at the URL like below. If you need to know ID at runtime dynamically then refer last section.</p>
<p>&nbsp;</p>
<div id="attachment_8450" style="width: 806px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2016/09/obtain-google-sheet-id-for-api-call.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8450" class="size-full wp-image-8450" src="https://zappysys.com/blog/wp-content/uploads/2016/09/obtain-google-sheet-id-for-api-call.png" alt="Get Google Drive File ID for API call (Sheet ID)" width="796" height="286" srcset="https://zappysys.com/blog/wp-content/uploads/2016/09/obtain-google-sheet-id-for-api-call.png 796w, https://zappysys.com/blog/wp-content/uploads/2016/09/obtain-google-sheet-id-for-api-call-300x108.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/09/obtain-google-sheet-id-for-api-call-768x276.png 768w" sizes="(max-width: 796px) 100vw, 796px" /></a><p id="caption-attachment-8450" class="wp-caption-text">Get Google Drive File ID for API call (Sheet ID)</p></div>
<h2>Reading Google SpreadSheet Data in SSIS</h2>
<p>Basically there are two ways you can export / read Google SpreadSheet data.</p>
<ul>
<li>Method-1 : Read Google SpreadSheet using SSIS JSON / REST API Source
<ul>
<li>In this approach we directly pull data from SpreadSheet using <a href="https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/get" target="_blank" rel="noopener">Core Google SpreadSheet.Values API</a> to read particular Tab from Sheet and you can also specify Range. This is most effective way to read. Make sure you have <strong>v2.5.0.10807 or higher version</strong> (released after Aug 03 2017). New version added <a href="//zappysys.com/blog/parse-multi-dimensional-json-array-ssis/" target="_blank" rel="noopener">2D array transformation options to parse multi-dimensional arrays</a> found in SpreadSheet API JSON response.</li>
</ul>
</li>
<li>Method-2 : Read Google SpreadSheet using Flat File Source (as CSV)
<ul>
<li>Another approach is export SpreadSheet as CSV format. Then use Flat File Source to read that data and load into Target (E.g. SQL Server)</li>
</ul>
</li>
</ul>
<h3>Method-1 : Read Google SpreadSheet using SSIS JSON / REST API Source</h3>
<p>Now lets look at real steps to read Google SpreadSheet. To get values from specific tab and specific cell-row range you have to use <a href="https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/get" target="_blank" rel="noopener">Google SpreadSheet.Values API</a></p>
<p>In this example we will load below Google Spreadsheet into SQL Server</p>
<p><a href="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-reading-google-spreadsheet-example.png"><img loading="lazy" decoding="async" class="alignnone wp-image-1657" src="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-reading-google-spreadsheet-example.png" alt="" width="521" height="327" srcset="https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-reading-google-spreadsheet-example.png 777w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-reading-google-spreadsheet-example-300x188.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-reading-google-spreadsheet-example-768x482.png 768w" sizes="(max-width: 521px) 100vw, 521px" /></a></p>
<h4><strong>Step-By-Step : Loading Google SpreadSheet into SQL Server using SSIS</strong></h4>
<ol>
<li>Drag and drop data flow on the control flow designer surface</li>
<li>Double click data flow and you will see SSIS Toolbox refreshed with new components</li>
<li>Drag ZS JSON Source from SSIS Toolbox onto Data flow designer surface</li>
<li>Double click JSON SOurce and configure below setting
<ol>
<li>Enter your Spreadsheet URL in the following format<br />
<pre class="crayon-plain-tag">https://sheets.googleapis.com/v4/spreadsheets/{your-file-id}/values/{cell-range}</pre>
For example purpose we will use <a href="https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit#gid=0" target="_blank" rel="noopener">this public SpreadSheet provided by Google</a>. If spreadsheet fileid is <strong>1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms</strong> (see previous section how to get fileid) and your tab name is <strong>Class Data</strong> and you like to extract data from <strong>A to F</strong> columns <strong>starting from 2nd row</strong> then your Cell range in the URL can be <strong>&#8216;Class Data&#8217;!A2:F</strong><br />
Here is the actual URL we will use for demo<br />
<pre class="crayon-plain-tag">https://sheets.googleapis.com/v4/spreadsheets/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/values/'Class Data'!A2:F</pre>
&#8212; OR &#8212;<br />
You can also enter like below (If you omit Tab name then first table is used)<br />
<pre class="crayon-plain-tag">https://sheets.googleapis.com/v4/spreadsheets/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/values/A1:F

--OR-- Use below URL for to supply Column names manually (Start from A2)

https://sheets.googleapis.com/v4/spreadsheets/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/values/A2:F</pre>
You can also enter like below, specify first row and last row<br />
<pre class="crayon-plain-tag">https://sheets.googleapis.com/v4/spreadsheets/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/values/A1:F101</pre>
</li>
<li>Check Use credentials and select OAuth connection we created in previous section</li>
<li>Click on Select Filter and select values node and click OK  or you can directly enter following filter.<br />
<pre class="crayon-plain-tag">$.values[*]</pre>
<div id="attachment_1652" style="width: 894px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-configure-json-source-read-google-spreadsheet-data-rest-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1652" class="size-full wp-image-1652" src="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-configure-json-source-read-google-spreadsheet-data-rest-api.png" alt="Configure SSIS JSON/REST API Source - Read data from Google SpreadSheet API " width="884" height="673" srcset="https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-configure-json-source-read-google-spreadsheet-data-rest-api.png 884w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-configure-json-source-read-google-spreadsheet-data-rest-api-300x228.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-configure-json-source-read-google-spreadsheet-data-rest-api-768x585.png 768w" sizes="(max-width: 884px) 100vw, 884px" /></a><p id="caption-attachment-1652" class="wp-caption-text">Configure SSIS JSON/REST API Source &#8211; Read data from Google SpreadSheet API</p></div></li>
<li>Now click on array Transformation tab. Now we will show you two different ways to configure column names.</li>
<li><strong>Method-1: Auto Detect Column Names</strong> (added in <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/release-notes.htm" target="_blank" rel="noopener">version 3.1.2</a>)<br />
In recent version we added column less array transformation where we have option to detect first record as column name.</p>
<ol>
<li>Select Transform Type as Column less array</li>
<li>Check option First line has column names like below example (Ignore direct Sample JSON &#8211; We provided for demo only. In your case it will be URL)
<div id="attachment_9118" style="width: 645px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/08/columnless-array-first-line-has-names-pattern.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9118" class="wp-image-9118 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/08/columnless-array-first-line-has-names-pattern.png" alt="JSON With 2D Array Pattern - Column names in First Row (Google Sheets API Pattern)" width="635" height="669" srcset="https://zappysys.com/blog/wp-content/uploads/2017/08/columnless-array-first-line-has-names-pattern.png 635w, https://zappysys.com/blog/wp-content/uploads/2017/08/columnless-array-first-line-has-names-pattern-285x300.png 285w" sizes="(max-width: 635px) 100vw, 635px" /></a><p id="caption-attachment-9118" class="wp-caption-text">JSON With 2D Array Pattern &#8211; Column names in First Row (Google Sheets API Pattern)</p></div></li>
</ol>
</li>
<li><strong>Method-2: Manually Enter Column Names</strong> (For old version)
<ol>
<li>Select Transform simple 2D array option from dropdown</li>
<li>Check Specify columns list manually</li>
<li>Enter column names (Must match the order and count based on range you selected)<br />
<pre class="crayon-plain-tag">Student Name,Gender,Class Level,Home State,Major,Extracurricular Activity</pre>
<div id="attachment_1653" style="width: 878px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-configure-json-source-read-google-spreadsheet-data-rest-api-2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1653" class="size-full wp-image-1653" src="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-configure-json-source-read-google-spreadsheet-data-rest-api-2.png" alt="Configure SSIS JSON/REST API Source 2D Array Transformation for Google SpreadSheet API " width="868" height="255" srcset="https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-configure-json-source-read-google-spreadsheet-data-rest-api-2.png 868w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-configure-json-source-read-google-spreadsheet-data-rest-api-2-300x88.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-configure-json-source-read-google-spreadsheet-data-rest-api-2-768x226.png 768w" sizes="(max-width: 868px) 100vw, 868px" /></a><p id="caption-attachment-1653" class="wp-caption-text">Configure SSIS JSON/REST API Source 2D Array Transformation for Google SpreadSheet API</p></div></li>
</ol>
</li>
<li>Now click Preview to see the data
<div id="attachment_1654" style="width: 872px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-configure-json-source-read-google-spreadsheet-data-rest-api-3.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1654" class="size-full wp-image-1654" src="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-configure-json-source-read-google-spreadsheet-data-rest-api-3.png" alt="Configure SSIS JSON/REST API Source - Preview Google SpreadSheet Data" width="862" height="678" srcset="https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-configure-json-source-read-google-spreadsheet-data-rest-api-3.png 862w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-configure-json-source-read-google-spreadsheet-data-rest-api-3-300x236.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-configure-json-source-read-google-spreadsheet-data-rest-api-3-768x604.png 768w" sizes="(max-width: 862px) 100vw, 862px" /></a><p id="caption-attachment-1654" class="wp-caption-text">Configure SSIS JSON/REST API Source &#8211;<br />Preview Google SpreadSheet Data</p></div></li>
<li>Click OK to save UI</li>
<li>Attach your JSON Source to target (e.g. OLEDB Destination for SQL Server Table).</li>
<li>Configure Destination
<div id="attachment_1655" style="width: 825px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-configure-google-spreadsheet-to-sql-server-load.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1655" class="size-full wp-image-1655" src="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-configure-google-spreadsheet-to-sql-server-load.png" alt="Configure SQL Server destination for Google SpreadSheet to SQL Data load" width="815" height="489" srcset="https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-configure-google-spreadsheet-to-sql-server-load.png 815w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-configure-google-spreadsheet-to-sql-server-load-300x180.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-configure-google-spreadsheet-to-sql-server-load-768x461.png 768w" sizes="(max-width: 815px) 100vw, 815px" /></a><p id="caption-attachment-1655" class="wp-caption-text">Configure SQL Server destination for Google SpreadSheet to SQL Data load</p></div></li>
<li>Execute SSIS Package to load Google SpreadSheet data int SQL Server
<div id="attachment_1656" style="width: 628px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-loading-google-spreadsheet-to-sql-server-example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1656" class="size-full wp-image-1656" src="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-loading-google-spreadsheet-to-sql-server-example.png" alt="SSIS Example -Loading data from Google SpreadSheet into SQL Server Table" width="618" height="311" srcset="https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-loading-google-spreadsheet-to-sql-server-example.png 618w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-loading-google-spreadsheet-to-sql-server-example-300x151.png 300w" sizes="(max-width: 618px) 100vw, 618px" /></a><p id="caption-attachment-1656" class="wp-caption-text">SSIS Example -Loading data from Google SpreadSheet into SQL Server Table</p></div></li>
</ol>
</li>
</ol>
<h3>Method-2 : Read Google SpreadSheet using Flat File Source (as CSV)</h3>
<p>Once we have Google Drive fileId we can perform following actions to export data into CSV file format. After that you can easily read CSV using SSIS FlatFile Source and load into SQL Server or other target.</p>
<h4>Export Google SpreadSheet as CSV file using SSIS REST API Task</h4>
<p>Here are the steps to export Google Drive SpreadSheet to CSV file</p>
<ol>
<li>Just like previous section configure REST API Task</li>
<li>Enter following URL (See we used FileId from SSIS variable. You can hardcode too.<br />
<pre class="crayon-plain-tag">https://www.googleapis.com/drive/v3/files/{{User::varFileId}}/export?mimeType=text/csv</pre>
</li>
<li>Goto response tab. Check Save response and select &#8220;Save to file option&#8221;.</li>
<li>Enter file path.</li>
<li>Response character set select utf-8 (This will allow Unicode characters in response)</li>
<li>Click Test to see preview
<div id="attachment_850" style="width: 610px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-export-google-spreadsheet-to-csv-format-call-google-drive-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-850" class="wp-image-850" src="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-export-google-spreadsheet-to-csv-format-call-google-drive-api.png" alt="Export Google SpreadSheet to CSV file format using SSIS - Call Google Drive API to Export" width="600" height="503" srcset="https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-export-google-spreadsheet-to-csv-format-call-google-drive-api.png 701w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-export-google-spreadsheet-to-csv-format-call-google-drive-api-300x252.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><p id="caption-attachment-850" class="wp-caption-text">Export Google SpreadSheet to CSV file format using SSIS &#8211; Call Google Drive API to Export</p></div></li>
<li>Click OK to save</li>
</ol>
<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;">NOTE: New version now includes CSV Source for API. Use that if you want to consume Google Spread Sheet data in Data Flow. However we still recommend JSON Source (As per previous section to read data. Use CSV export method only if JSON API is not working for you for some reason.</div></div>
<h4>Load Google SpreadSheet data into SQL Server using SSIS (REST API Call)</h4>
<p>Once you export SpreadSheet to CSV file you can easily consume it to load into SQL Server or any Target (e.g. Oracle, MySQL) using Native SSIS FlatFile Source and OLEDB/ADO.net Destination.</p>
<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> Using FlatFile Source is not covered in Article. You can find many articles online which shows how to use SSIS FlatFile Source.</div></div>
<h2>Write data to Google Spread Sheet</h2>
<p>Now lets look at how to write to Google SpreadSheet. To write multiple rows in a single request you may use <a href="https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/batchUpdate" target="_blank" rel="noopener">batchUpdate API</a>. Also check this link to <a href="https://developers.google.com/sheets/api/guides/values" target="_blank" rel="noopener">learn more</a>.</p>
<p>Below is sample request to write data to columns and some data to rows (set majorDimension = <strong>COLUMNS</strong> to <strong>write vertical</strong> and use <strong>ROWS</strong> to <strong>write horizontally</strong>. You can mix multiple ways just like below example)</p><pre class="crayon-plain-tag">POST 
https://sheets.googleapis.com/v4/spreadsheets/1lkMEgu0zm2Q-cnPeoNZp4hqeIuASxXSpsrxtDDV89tg/values:batchUpdate
Authorization: Bearer ya29.Gl3WBFb3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json
Accept: */*

{
  "valueInputOption": "USER_ENTERED",
  "data": [
    {
      "range": "Sheet2!A1:A4",
      "majorDimension": "COLUMNS",
      "values": [
        ["Item", "Wheel", "Door", "Engine"]
      ]
    },
    {
      "range": "Sheet2!B1:D2",
      "majorDimension": "ROWS",
      "values": [
        ["Cost", "Stocked", "Ship Date"],
        ["$20.50", "4", "3/1/2016"]
      ]
    }
  ]
}</pre><p>
<div id="attachment_2050" style="width: 1282px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-write-google-spreadsheet-using-rest-api-oauth.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2050" class="size-full wp-image-2050" src="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-write-google-spreadsheet-using-rest-api-oauth.png" alt="Write data to Google SpreadSheet using REST API Task (OAuth 2.0 Connection)" width="1272" height="668" srcset="https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-write-google-spreadsheet-using-rest-api-oauth.png 1272w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-write-google-spreadsheet-using-rest-api-oauth-300x158.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-write-google-spreadsheet-using-rest-api-oauth-768x403.png 768w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-write-google-spreadsheet-using-rest-api-oauth-1024x538.png 1024w" sizes="(max-width: 1272px) 100vw, 1272px" /></a><p id="caption-attachment-2050" class="wp-caption-text">Write data to Google SpreadSheet using REST API Task (OAuth 2.0 Connection)</p></div>
<p>&nbsp;</p>
<h2>Update Google Sheet Cells &#8211; Single Range (Set Values for multiple cells)</h2>
<p>Now let&#8217;s look at the below example of updating multiple cells in google Sheet. For more information, you can see the <a href="https://developers.google.com/sheets/api/samples/writing" target="_blank" rel="noopener">example here</a>. For parameter detail review this API documentation.</p>
<p>You can use<a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener"> SSIS REST API Task</a> or <a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">Web API Destination</a> to achieve Spread Sheet Update scenario. For simple example lets use REST API Task.</p>
<ol>
<li>Drag and Drop ZS REST API Task on the control flow designer</li>
<li>Edit Task and select URL from Connection Method</li>
<li>Select OAuth Connection from the dropdown (Same connection we created in the previous section)</li>
<li>Enter the URL as below. Change Sheet ID, Range designator and API URL Parameters as per your need.<br />
<em>https://sheets.googleapis.com/v4/spreadsheets/<strong>[Sheet-ID-Here]</strong>/values/<strong>[Range-Here]</strong></em>?[<em><strong>Parameters-Here]
</strong></em><strong>Example URL (some part masked with xxxxxxxx):  </strong><br />
<pre class="crayon-plain-tag">https://sheets.googleapis.com/v4/spreadsheets/1tuGO3_-2JlSmyiHwX6xxxxxxxxCHrORJc/values/Sheet1!A2:B4?valueInputOption=USER_ENTERED</pre>
</li>
<li>Change Request Method to <strong>PUT</strong></li>
<li>Change Request Content type to <strong>application/json</strong></li>
<li>Enter Request Body as below (Assuming we need to update 4 cells)<br />
<pre class="crayon-plain-tag">{
"majorDimension": "ROWS",
  "values": [
   ["row1_cellA","row1_cellB"],
   ["row2_cellA","row2_cellB"],
  ]
}</pre>
</li>
<li>Click Test Request see it works.
<div id="attachment_4521" style="width: 947px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-update-google-sheet-using-rest-api-multiple-cells.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4521" class="size-full wp-image-4521" src="https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-update-google-sheet-using-rest-api-multiple-cells.png" alt="Calling Google Sheet API to Update Multiple Cell Values" width="937" height="948" srcset="https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-update-google-sheet-using-rest-api-multiple-cells.png 937w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-update-google-sheet-using-rest-api-multiple-cells-297x300.png 297w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-update-google-sheet-using-rest-api-multiple-cells-768x777.png 768w" sizes="(max-width: 937px) 100vw, 937px" /></a><p id="caption-attachment-4521" class="wp-caption-text">Calling Google Sheet API to Update Multiple Cell Values</p></div></li>
</ol>
<h2>Update Google Sheet Cells &#8211; Multiple Ranges</h2>
<p>If you like to update values which needs to define multiple ranges then you need to use <a href="https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/batchUpdate" target="_blank" rel="noopener">batchUpdate API</a>. Import changes are you can&#8217;t include Range in the URL like previous example of Single Range Update. Also you have to use POST method and body with multiple ranges.</p>
<p>Example of sheet update with multiple range</p><pre class="crayon-plain-tag">POST https://sheets.googleapis.com/v4/spreadsheets/1tuGO3_-2JlSmyiHxxxxxxxxxxxxxxxc/values:batchUpdate?valueInputOption=USER_ENTERED
Content-Type: application/json

&gt;&gt;&gt;&gt; BODY &lt;&lt;&lt;&lt;&lt;

{
  "data": [
    {
      "range": "Sheet1!A2:B3",
      "majorDimension": "ROWS",
      "values": [
        [
          "row1_cellA",
          "row1_cellB"
        ],
        [
          "row2_cellA",
          "row2_cellB"
        ]
      ]
    },
    {
      "range": "Sheet1!D2:E3",
      "majorDimension": "ROWS",
      "values": [
        [
          "row1_cellD",
          "row1_cellE"
        ],
        [
          "row2_cellD",
          "row2_cellE"
        ]
      ]
    }
  ]
}</pre><p>
&nbsp;</p>
<h2>Write SQL Server data to Google Sheet</h2>
<p>Now let&#8217;s look at real world example. How to write data from SQL Server table or other source and send to Google Sheet.</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>Drag source (e.g. OLEDB Source) and configure it to read from source like SQL Server Table
<div id="attachment_7289" style="width: 515px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/oledb-source-drag-and-drop.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7289" class="size-full wp-image-7289" src="https://zappysys.com/blog/wp-content/uploads/2019/06/oledb-source-drag-and-drop.png" alt="OLE DB Source - Drag and Drop" width="505" height="190" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/oledb-source-drag-and-drop.png 505w, https://zappysys.com/blog/wp-content/uploads/2019/06/oledb-source-drag-and-drop-300x113.png 300w" sizes="(max-width: 505px) 100vw, 505px" /></a><p id="caption-attachment-7289" class="wp-caption-text">OLE DB Source &#8211; Drag and Drop</p></div></li>
<li>Drag <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/">ZS JSON Generator</a>.
<ol>
<li>Connect Source to JSON Generator (blue arrow)</li>
<li>Double click it to configure</li>
<li>Select Output Mode as <strong>Single Dataset Array</strong> option for Mode. Enter Some Batch value (e.g. 500) this will make sure we send 500 rows at a time to Google API call. This way if we have many rows its not rejected by API call.</li>
<li>Click <strong>Add element</strong> (Select <strong>Static Element</strong>) . Name: <strong>majorDimension</strong> and Value: <strong>ROWS</strong></li>
<li>Now click Add Document Array icon, name as <strong>values</strong></li>
<li>check Treat as <strong>2D array</strong> option and click OK to save</li>
<li>Now under values node click <strong>Add elements</strong> &gt; Select <strong>Multiple Columns</strong> and Add columns you like to add.</li>
<li>Click OK to save JSON GeneratorBelow is just an example How you can use Batch Settings to create JSON with N rows in each JSON document.<br />
<img decoding="async" src="https://i2.wp.com/zappysys.com/blog/wp-content/uploads/2019/02/ssis-generate-json-with-batch-setting.png?resize=720%2C564&amp;ssl=1" alt="Using SSIS JSON Generator Transform with Batch Option (Multiple Records in a single document)" /></li>
</ol>
</li>
<li>Now drag <a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">ZS Web API destination</a>
<ol>
<li>Connect JSON Generator to Web API destination (blue arrow)</li>
<li>Double click it to configure</li>
<li>Select same OAuth connection manager created in earlier section (Assuming you had all scopes with write permission)</li>
<li>Now select <strong>Input column</strong> for <strong>Body </strong>(JSON Generator Output)</li>
<li>Enter API call URL as below (Replace <strong>ID</strong> with your own id)<br />
<pre class="crayon-plain-tag">https://sheets.googleapis.com/v4/spreadsheets/{your-file-id}/values/Sheet1!A2?valueInputOption=USER_ENTERED</pre>
</li>
<li>Select Request Method as <strong>PUT</strong></li>
<li>Select content type as <strong>application/json</strong></li>
<li>You can enter sample Body As below.<br />
<pre class="crayon-plain-tag">{
"majorDimension": "ROWS",
  "values": [
   ["Bob","bob@mycompany.com",55],
   ["Sam","sam@mycompany.com",57]
  ]
}</pre>
</li>
<li>Click Test Request / Response button. Check your Sheet in browser after it see it updates?</li>
<li>If you see <strong>200 OK</strong> response means we are good to go.</li>
<li>Run package and see your real data updated in Sheet.</li>
</ol>
</li>
</ol>
<h2>Format Cells using Google Sheet API</h2>
<p>Now let&#8217;s look at an example to format cell using Google Sheet API (e.g. Change Font, Color, Border, Background). For more information review <a href="https://developers.google.com/sheets/api/samples/formatting" target="_blank" rel="noopener">this API documentation</a>.</p>
<p>To format Sheet you first need to get SheetID  (keep in mind this is not same as spreadsheetId which you used in URL). SheetId is basically numeric ID of your Tab in WorkSheet.</p>
<h3>Get SheetID</h3>
<p><strong>Request</strong></p><pre class="crayon-plain-tag">GET https://sheets.googleapis.com/v4/spreadsheets/1tuGO3_-2JlSmyiHtxxxxxxxxxxxxxx</pre><p>
<strong>Response</strong></p><pre class="crayon-plain-tag">{
  "spreadsheetId": "1tuGO3_-2JlSmyiHwX6bRFUWqqrXlt4BRoX8rCHrORJc",
  "properties": {
    "title": "Test.xlsx",
    "locale": "en",
    "autoRecalc": "ON_CHANGE",
    "timeZone": "America/Los_Angeles",
    "defaultFormat": {
      "backgroundColor": {
        "red": 1,
        "green": 1,
        "blue": 1
      },
      "padding": {
        "right": 3,
        "left": 3
      },
      "verticalAlignment": "BOTTOM",
      "wrapStrategy": "OVERFLOW_CELL",
      "textFormat": {
        "foregroundColor": {},
        "fontFamily": "Calibri",
        "fontSize": 11,
        "bold": false,
        "italic": false,
        "strikethrough": false,
        "underline": false
      }
    }
  },
  "sheets": [
    {
      "properties": {
        "sheetId": 1896331083,
        "title": "Sheet1",
        "index": 0,
        "sheetType": "GRID",
        "gridProperties": {
          "rowCount": 1000,
          "columnCount": 26,
          "rowGroupControlAfter": true,
          "columnGroupControlAfter": true
        }
      }
    }
  ],
  "spreadsheetUrl": "https://docs.google.com/spreadsheets/d/1tuGO3_-2JlSmyiHwX6bRFUWqqrXlt4BRoX8rCHrORJc/edit"
}</pre><p>
Notice that in above response we see <strong>&#8220;sheetId&#8221;: 1896331083</strong>. This ID we will use in the Update API to format Cells.</p>
<h3>Update Borders Example</h3>
<p>Here is the example of Google Sheet Formatting API <a href="https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#updatebordersrequest" target="_blank" rel="noopener">updateBorders Request</a></p><pre class="crayon-plain-tag">POST https://sheets.googleapis.com/v4/spreadsheets/1tuGO3_-2JlSxxxxlt4BRoX8rCHrORJc:batchUpdate
Content-Type: application/json

&gt;&gt;&gt;&gt; BODY &lt;&lt;&lt;&lt;&lt;

{
  "requests": [
    {
      "updateBorders": {
        "range": {
          "sheetId": 1896331083,
          "startRowIndex": 0,
          "endRowIndex": 10,
          "startColumnIndex": 0,
          "endColumnIndex": 6
        },
        "top": {
          "style": "DASHED",
          "width": 1,
          "color": {
            "blue": 1.0
          },
        },
        "bottom": {
          "style": "DASHED",
          "width": 1,
          "color": {
            "blue": 1.0
          },
        },
        "innerHorizontal": {
          "style": "DASHED",
          "width": 1,
          "color": {
            "blue": 1.0
          },
        },
      }
    }
  ]
}</pre><p>
<strong>Response</strong></p><pre class="crayon-plain-tag">{
  "spreadsheetId": "1tuGO3_-2JlSmyiHwX6bRFUWqqrXlt4BRoX8rCHrORJc",
  "replies": [
    {}
  ]
}</pre><p>
&nbsp;</p>
<h3>Update Cell Font Style (Bold, Style, Color, Background)</h3>
<p>Now let&#8217;s look at how to use <a href="https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#RepeatCellRequest" target="_blank" rel="noopener">repeateCellRequest</a> to apply certain type of formatting to multiple cells. This may be color, font style, background color.</p><pre class="crayon-plain-tag">POST https://sheets.googleapis.com/v4/spreadsheets/1tuGO3xxxxxx4BRoX8rCHrORJc:batchUpdate
Content-Type: application/json

&gt;&gt;&gt;&gt; BODY &lt;&lt;&lt;&lt;&lt;

{
  "requests": [
    {
      "repeatCell": {
        "range": {
          "sheetId": 1896331083,
          "startRowIndex": 0,
          "endRowIndex": 1
        },
        "cell": {
          "userEnteredFormat": {
            "backgroundColor": {
              "red": 0,
              "green": 0.5,
              "blue": 0.7,
              "alpha": 1.3
            },
            "textFormat": {
              "foregroundColor": {
                "red": 1
              },
              "bold": true,
              "italic": true,
              "strikethrough": true,
              "underline": true
            }
          }
        },
        "fields": "userEnteredFormat"
      }
    }
  ]
}</pre><p>
In above example we have applied <strong>textFormat</strong> and <strong>backgroundColor</strong> but you can use any of below sections.<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;">
<span class="pun">{<br />
</span><span class="str">&#8220;numberFormat&#8221;<span class="pun">: </span><span class="pun">{</span><span class="kwd">object(<code><a href="https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets#NumberFormat">NumberFormat</a></code>)</span> <span class="pun">}</span><span class="pun">,</span><br />
&#8220;backgroundColor&#8221;<span class="pun">: </span><span class="pun">{</span> <span class="kwd">object(<code><a href="https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets#Color">Color</a></code>)</span> <span class="pun">}</span><span class="pun">,</span><br />
&#8220;borders&#8221;<span class="pun">: </span><span class="pun">{</span> <span class="kwd">object(<code><a href="https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets#Borders">Borders</a></code>)</span> <span class="pun">}</span><span class="pun">,</span><br />
&#8220;padding&#8221;<span class="pun">: </span><span class="pun">{</span> <span class="kwd">object(<code><a href="https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets#Padding">Padding</a></code>)</span> <span class="pun">}</span><span class="pun">,</span><br />
&#8220;horizontalAlignment&#8221;<span class="pun">: </span><span class="kwd">enum(<code><a href="https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets#HorizontalAlign">HorizontalAlign</a></code>)</span><span class="pun">,</span><br />
&#8220;verticalAlignment&#8221;<span class="pun">: </span><span class="kwd">enum(<code><a href="https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets#VerticalAlign">VerticalAlign</a></code>)</span><span class="pun">,</span><br />
&#8220;wrapStrategy&#8221;<span class="pun">: </span><span class="kwd">enum(<code><a href="https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets#WrapStrategy">WrapStrategy</a></code>)</span><span class="pun">,</span><br />
&#8220;textDirection&#8221;<span class="pun">: </span><span class="kwd">enum(<code><a href="https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets#TextDirection">TextDirection</a></code>)</span><span class="pun">,</span><br />
&#8220;textFormat&#8221;<span class="pun">: </span><span class="pun">{</span> <span class="kwd">object(<code><a href="https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets#TextFormat">TextFormat</a></code>)</span> <span class="pun">}</span><span class="pun">,<br />
</span> &#8220;hyperlinkDisplayType&#8221;<span class="pun">: </span><span class="kwd">enum(<code><a href="https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets#HyperlinkDisplayType">HyperlinkDisplayType</a></code>)</span><span class="pun">,</span><br />
&#8220;textRotation&#8221;<span class="pun">: </span><span class="pun">{</span> <span class="kwd">object(<code><a href="https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets#TextRotation">TextRotation</a></code>)</span> <span class="pun">}</span><br />
<span class="pun">}</span></span><br />
</div></div>
<h3>Set Currency Formatting</h3>
<p>Here is an example request to set currency formatting</p><pre class="crayon-plain-tag">POST https://sheets.googleapis.com/v4/spreadsheets/1tuGO3_-2JlSmyiHwX6bRFUWqqrXlt4BRoX8rCHrORJc:batchUpdate
Content-Type: application/json

&gt;&gt;&gt;&gt; BODY &lt;&lt;&lt;&lt;&lt;

{
  "requests": [
    {
      "repeatCell": {
        "range": {
          "sheetId": 1896331083,
          "startRowIndex": 1,
          "startColumnIndex": 4,
          "endColumnIndex": 5
        },
        "cell": {
          "userEnteredFormat": {
            "numberFormat": {
              "type": "CURRENCY",
              "pattern": "$#,##0.00"
            }
          }
        },
        "fields": "userEnteredFormat.numberFormat"
      }
    }
  ]
}</pre><p>
<h3>Set Cell Validation</h3>
<p>You can also set cell validation by calling following API call. This will restrict user&#8217;s ability to enter wrong data in certain cells.</p><pre class="crayon-plain-tag">POST https://sheets.googleapis.com/v4/spreadsheets/1tuGO3_-2JlSmyiHwX6bRFUWqqrXlt4BRoX8rCHrORJc:batchUpdate
Content-Type: application/json

&gt;&gt;&gt;&gt; BODY &lt;&lt;&lt;&lt;&lt;

{
  "requests": [
    {
      "setDataValidation": {
        "range": {
          "sheetId": 1896331083,
          "startRowIndex": 1,
          "startColumnIndex": 0,
          "endColumnIndex": 6
        },
        "rule": {
          "condition": {
            "type": "ONE_OF_LIST",
            "values": [
              {
                "userEnteredValue": "Red"
              },
              {
                "userEnteredValue": "Green"
              },
              {
                "userEnteredValue": "Yellow"
              }
            ]
          },
          "inputMessage": "Color must be Red, Yellow or Green",
          "strict": true,
          "showCustomUi": true
        }
      }
    }
  ]
}</pre><p>
&nbsp;</p>
<h2>Dynamically obtain File ID for Google Drive REST API call</h2>
<p>Once OAuth connection is defined you can now call any valid API from Google based on Permission you requested in OAuth Connection. OAuth connection takes care of renewing you Token and passing Authorization as per OAuth standard. All these protocol complexity is hidden from you.</p>
<p>First step to get data from Google SpreadSheet using REST API call is get fileId of the Google Drive File you want to read. The easiest way to know file ID is call following API. Below API call returns name, ID and other information about file(s). You can get only fileID and use that in Next Section to export Google SpreadSheet to CSV format.</p><pre class="crayon-plain-tag">https://www.googleapis.com/drive/v3/files</pre><p>
OR</p><pre class="crayon-plain-tag">https://www.googleapis.com/drive/v3/files/?q=name%3D'Customers'</pre><p>
<strong>NOTE:</strong> For more information about searching files in Google drive / getting list of files using search expression language <a href="https://developers.google.com/drive/v3/web/search-parameters#examples" target="_blank" rel="noopener">check this link.</a> Make sure expression is URL encoded (e.g. name=&#8217;Customers&#8217; should be passed as name%3D&#8217;Customers&#8217;)</p>
<p>Above API returns response as below. Notice the name and fileId. We will use <strong>fileId</strong> when calling export API in next section.</p><pre class="crayon-plain-tag">{
 "kind": "drive#fileList",
 "files": [
  {
   "kind": "drive#file",
   "id": "1lkMEgu0zm2Q-cnPeoNZp4hqeIuASxXSpsrxtDDV89tg",
   "name": "Customers",
   "mimeType": "application/vnd.google-apps.spreadsheet"
  },
  {
   "kind": "drive#file",
   "id": "0B6UyXr6ZlIFTc3RhcnRlcl9maWxl",
   "name": "How to get started with Drive",
   "mimeType": "application/pdf"
  }
 ]
}</pre><p>
If you want to automate retrieval of fileId from document name then perform the following steps.</p>
<ol>
<li>In the SSIS package Control flow. Drag and drop ZS REST API Task from SSIS toolbox</li>
<li>In the Request Access mode, select &#8220;URL from Connection&#8221; option</li>
<li>Select OAuth connection manager (Created in Section-2)</li>
<li>Enter URL as below (It will return any file name equals to Customers (%3D is encoded value for = sign)<br />
<pre class="crayon-plain-tag">https://www.googleapis.com/drive/v3/files/?q=name%3D'Customers'</pre>
</li>
<li>Click Test (You will see file information)
<div id="attachment_848" style="width: 610px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-call-google-drive-api-get-file-list.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-848" class="wp-image-848" src="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-call-google-drive-api-get-file-list.png" alt="Get Google Drive File List in SSIS - Call Google Drive API. Search file by name or expression " width="600" height="451" srcset="https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-call-google-drive-api-get-file-list.png 776w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-call-google-drive-api-get-file-list-300x225.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><p id="caption-attachment-848" class="wp-caption-text">Get Google Drive File List in SSIS &#8211; Call Google Drive API to search file by name or expression</p></div></li>
<li>If you want to extract only fileID from full JSON then go to response tab</li>
<li>Select Format=JSON, Enter following JSONPath expression to extract only fileId from first record<br />
<pre class="crayon-plain-tag">$.files[0].id</pre>
</li>
<li>Check save response content, select SSIS variable where you want to save fileId as below. Now click Test to see preview of response. You will notice now only fileId will be returned from full JSON response.
<div id="attachment_849" style="width: 610px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-get-google-drive-fileid-from-file-name-using-api-call.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-849" class="wp-image-849" src="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-get-google-drive-fileid-from-file-name-using-api-call.png" alt="Get Google Drive fileid from file name using api call in SSIS" width="600" height="475" srcset="https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-get-google-drive-fileid-from-file-name-using-api-call.png 681w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-get-google-drive-fileid-from-file-name-using-api-call-300x237.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><p id="caption-attachment-849" class="wp-caption-text">Get Google Drive fileid from file name using API call in SSIS</p></div></li>
<li>Click OK to save task</li>
</ol>
<h2>Conclusion</h2>
<p>Google Drive API and Google Sheets API provides a great way to automate file related functionality. However, to call Google API  you have to use SDK / coding approach (e.g. C#, Java, Python, Ruby). Luckily ZappySys <a href="//zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a> provides a great way to integrate any Google API call via simple drag and drop approach without coding. Try out yourself see how long it takes to call virtually any REST API.</p>
<p>The post <a href="https://zappysys.com/blog/get-data-google-spreadsheet-using-ssis/">How to read / write Google SpreadSheet using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
