Google Sheets Connector for Azure Data Factory (Pipeline)

In this article you will learn how to integrate Google Sheets data in Azure Data Factory (Pipeline) without coding in just a few clicks (live / bi-directional connection to Google Sheets). Read / write Google Sheets data inside your app, perform many Google Sheets operations without coding using easy to use high performance API Connector for Google Sheets.

Using Google Sheets Connector you will be able to connect, read, and write data from within Azure Data Factory (Pipeline). Follow the steps below to see how we would accomplish that.

Download Documentation

Create ODBC Data Source (DSN) based on ZappySys API Driver

Step-by-step instructions

To get data from Google Sheets using Azure Data Factory (Pipeline) we first need to create a DSN (Data Source) which will access data from Google Sheets. We will later be able to read data using Azure Data Factory (Pipeline). Perform these steps:

  1. Install ZappySys ODBC PowerPack.

  2. Open ODBC Data Sources (x64):
    Open ODBC Data Source

  3. Create a System Data Source (System DSN) based on ZappySys API Driver

    ZappySys API Driver
    Create new System DSN for ZappySys API Driver
    You should create a System DSN (instead of a User DSN) if the client application is launched under a Windows System Account, e.g. as a Windows Service. If the client application is 32-bit (x86) running with a System DSN, use ODBC Data Sources (32-bit) instead of the 64-bit version. Furthermore, a User DSN may be created instead, but then you will not be able to use the connection from Windows Services(or any application running under a Windows System Account).
  4. When the Configuration window appears give your data source a name if you haven't done that already, then select "Google Sheets" from the list of Popular Connectors. If "Google Sheets" is not present in the list, then click "Search Online" and download it. Then set the path to the location where you downloaded it. Finally, click Continue >> to proceed with configuring the DSN:

    GoogleSheetsDSN
    Google Sheets
    ODBC DSN Template Selection

  5. Now it's time to configure the Connection Manager. Select Authentication Type, e.g. Token Authentication. Then select API Base URL (in most cases, the default one is the right one). More info is available in the Authentication section.

    User accounts represent a developer, administrator, or any other person who interacts with Google APIs and services. User accounts are managed as Google Accounts, either with Google Workspace or Cloud Identity. They can also be user accounts that are managed by a third-party identity provider and federated with Workforce Identity Federation. [API reference]

    Steps how to get and use Google Sheets credentials

    Follow these steps on how to create Client Credentials (User Account principle) to authenticate and access Google Sheets API in SSIS package or ODBC data source:

    WARNING: If you are planning to automate processes, we recommend that you use a Service Account authentication method. In case, you still need to use User Account, then make sure you use a system/generic account (e.g. automation@my-company.com). When you use a personal account which is tied to a specific employee profile and that employee leaves the company, the token may become invalid and any automated processes using that token will start to fail.

    Step-1: Create project

    This step is optional, if you already have a project in Google Cloud and can use it. However, if you don't, proceed with these simple steps to create one:

    1. First of all, go to Google API Console.

    2. Then click Select a project button and then click NEW PROJECT button:

      Start creating a new project in Google Cloud
    3. Name your project and click CREATE button:

      Create a new project in Google Cloud
    4. Wait until the project is created:

      Wait until project is created in Google Cloud
    5. Done! Let's proceed to the next step.

    Step-2: Enable Google Cloud APIs

    In this step we will enable Google Sheets API and Google Drive API:

    1. Select your project on the top bar:

      Select project in Google Cloud
    2. Then click the "hamburger" icon on the top left and access APIs & Services:

      Access APIs and services in Google Cloud
    3. Now let's enable several APIs by clicking ENABLE APIS AND SERVICES button:

      Enable API for project in Google Cloud
    4. In the search bar search for sheets and then locate and select Google Sheets API:

      Search for API in Google Cloud
    5. Then enable Google Sheets API:

      Enable Google Sheets API
    6. Again, repeat the step and enable Google Drive API as well:

      Enable Google Drive API
    7. Done! Let's proceed to the next step.

    Step-3: Create OAuth application

    1. First of all, click the "hamburger" icon on the top left and then hit VIEW ALL PRODUCTS:

      View all products in Google Cloud
    2. Then access Google Auth Platform to start creating an OAuth application:

      Open Google Auth Platform in Google Cloud
    3. Start by pressing GET STARTED button:

      Start creating an app in Google Cloud
    4. Next, continue by filling in App name and User support email fields:

      Fill app info in Google Cloud
    5. Choose Internal option, if it's enabled, otherwise select External:

      Choose app audience in Google Cloud
    6. Optional step if you used Internal option in the previous step. Nevertheless, if you had to use External option, then click ADD USERS to add a user:

      Add test user in Google Cloud app
    7. Then add your contact Email address:

      Enter app contact info in Google Cloud
    8. Finally, check the checkbox and click CREATE button:

      Create app in Google Cloud
    9. Done! Let's create Client Credentials in the next step.

    Step-4: Create Client Credentials

    1. In Google Auth Platform, select Clients menu item and click CREATE CLIENT button:

      Start creating app client in Google Cloud
    2. Choose Desktop app as Application type and name your credentials:

      Create OAuth app client in Google Cloud
    3. Continue by opening the created credentials:

      View app client credentials in Google Cloud
    4. Finally, copy Client ID and Client secret for the later step:

      Use client ID and secret to read Google REST API data
    5. Done! We have all the data needed for authentication, let's proceed to the last step!

    Step-5: Configure connection

    1. Now go to SSIS package or ODBC data source and use previously copied values in User Account authentication configuration:

      • In the ClientId field paste the Client ID value.
      • In the ClientSecret field paste the Client secret value.
    2. Press Generate Token button to generate Access and Refresh Tokens.

    3. Open your Google Sheets spreadsheet in the browser, e.g.: https://docs.google.com/spreadsheets/d/1QM6WmGloHeGCliCqV3nEj8P-R1RbS59t5xJutN99rU/edit.

    4. Extract the spreadsheet Id from the URL and copy it to the clipboard, e.g. 1QM6WmGloHeGCliCqV3nEj8P-R1RbS59t5xJutN99rU.

    5. Go back to authentication configuration window and paste it into Default SpreadsheetId field.

    6. Finally, click Test Connection to confirm the connection is working.

    7. Done! Now you are ready to use Google Sheets Connector!

    Fill in all required parameters and set optional parameters if needed:

    GoogleSheetsDSN
    Google Sheets
    User Account [OAuth]
    https://sheets.googleapis.com/v4/spreadsheets
    Required Parameters
    UseCustomApp Fill-in the parameter...
    Scope Fill-in the parameter...
    Default SpreadSheetId Fill-in the parameter...
    Optional Parameters
    ClientId
    ClientSecret
    Default Tab Name (i.e. Sheet1)
    RetryMode RetryWhenStatusCodeMatch
    RetryStatusCodeList 403|429
    RetryCountMax 5
    Redirect URL (Only for Web App)
    ODBC DSN Oauth Connection Configuration

    Service accounts are accounts that do not represent a human user. They provide a way to manage authentication and authorization when a human is not directly involved, such as when an application needs to access Google Cloud resources. Service accounts are managed by IAM. [API reference]

    Steps how to get and use Google Sheets credentials

    Follow these steps on how to create Service Account to authenticate and access Google Sheets API in SSIS package or ODBC data source:

    Step-1: Create project

    This step is optional, if you already have a project in Google Cloud and can use it. However, if you don't, proceed with these simple steps to create one:

    1. First of all, go to Google API Console.

    2. Then click Select a project button and then click NEW PROJECT button:

      Start creating a new project in Google Cloud
    3. Name your project and click CREATE button:

      Create a new project in Google Cloud
    4. Wait until the project is created:

      Wait until project is created in Google Cloud
    5. Done! Let's proceed to the next step.

    Step-2: Enable Google Cloud APIs

    In this step we will enable Google Sheets API and Google Drive API:

    1. Select your project on the top bar:

      Select project in Google Cloud
    2. Then click the "hamburger" icon on the top left and access APIs & Services:

      Access APIs and services in Google Cloud
    3. Now let's enable several APIs by clicking ENABLE APIS AND SERVICES button:

      Enable API for project in Google Cloud
    4. In the search bar search for sheets and then locate and select Google Sheets API:

      Search for API in Google Cloud
    5. Then enable Google Sheets API:

      Enable Google Sheets API
    6. Again, repeat the step and enable Google Drive API as well:

      Enable Google Drive API
    7. Done! Let's proceed to the next step.

    Step-3: Create Service Account

    Use the steps below to create a Service Account in Google Cloud:

    1. First of all, go to IAM & Admin in Google Cloud console:

      Access IAM & Admin in Google Cloud
    2. Once you do that, click Service Accounts on the left side and click CREATE SERVICE ACCOUNT button:

      Start creating service account in Google Cloud
    3. Then name your service account and click CREATE AND CONTINUE button:

      Create service account in Google Cloud
    4. Continue by clicking Select a role dropdown and start granting service account Project Viewer roles:

      Start granting service account project roles in Google Cloud
    5. Find Project group and select Viewer role:

      Grant service account project viewer role
    6. Finish adding roles by clicking CONTINUE button:

      Finish granting service account project roles in Google Cloud
      You can always add or modify permissions later in IAM & Admin.
    7. Finally, in the last step, just click button DONE:

      Finish configuring service account in Google Cloud
    8. Done! We are ready to add a Key to this service account in the next step.

    Step-4: Add Key to Service Account

    We are ready to add a Key (P12 certificate) to the created Service Account:

    1. In Service Accounts open newly created service account:

      Open service account in Google Cloud
    2. Next, copy email address of your service account for the later step:

      Copy service account email address in Google Cloud
    3. Continue by selecting KEYS tab, then press ADD KEY dropdown, and click Create new key menu item:

      Start creating key for service account in Google Cloud
    4. Finally, select P12 option and hit CREATE button:

      Create P12 key for service account in Google Cloud
    5. P12 certificate downloads into your machine. We have all the data needed for authentication, let's proceed to the last step!

    Step-5: Configure connection

    1. Now go to SSIS package or ODBC data source and use previously copied values in User Account authentication configuration:

      • In the Service Account Email field paste the service account Email address value you copied in the previous step.
      • In the Service Account Private Key Path (i.e. *.p12) field use downloaded certificate's file path.
    2. Press Generate Token button to generate Access and Refresh Tokens.

    3. Open your Google Sheets spreadsheet in the browser, e.g.: https://docs.google.com/spreadsheets/d/1QM6WmGloHeGCliCqV3nEj8P-R1RbS59t5xJutN99rU/edit.

    4. Extract the spreadsheet Id from the URL and copy it to the clipboard, e.g. 1QM6WmGloHeGCliCqV3nEj8P-R1RbS59t5xJutN99rU.

    5. Go back to authentication configuration window and paste it into Default SpreadsheetId field.

    6. Finally, click Test Connection to confirm the connection is working.

    7. Done! Now you are ready to use Google Sheets Connector!

    Fill in all required parameters and set optional parameters if needed:

    GoogleSheetsDSN
    Google Sheets
    Service Account [OAuth]
    https://sheets.googleapis.com/v4/spreadsheets
    Required Parameters
    Service Account Email Fill-in the parameter...
    Service Account Private Key Path (i.e. *.p12) Fill-in the parameter...
    Default SpreadSheetId Fill-in the parameter...
    Optional Parameters
    Scope https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/spreadsheets
    Default Tab Name (i.e. Sheet1)
    RetryMode RetryWhenStatusCodeMatch
    RetryStatusCodeList 403|429
    RetryCountMax 5
    Impersonate As (Enter Email Id)
    ODBC DSN Oauth Connection Configuration

  6. Once the data source has been configured, you can preview data. Select the Preview tab and use settings similar to the following to preview data:
    ODBC ZappySys Data Source Preview

  7. Click OK to finish creating the data source.

Video instructions

Read data in Azure Data Factory (ADF) from ODBC datasource (Google Sheets)

  1. To start press New button:

    Create new Self-Hosted integration runtime
  2. Select "Azure, Self-Hosted" option:

    Create new Self-Hosted integration runtime
  3. Select "Self-Hosted" option:

    Create new Self-Hosted integration runtime
  4. Set a name, we will use "OnPremisesRuntime":

    Set a name for IR
  5. Download and install Microsoft Integration Runtime.

  6. Launch Integration Runtime and copy/paste Authentication Key from Integration Runtime configuration in Azure Portal:

    Copy/paste Authentication Key
  7. After finishing registering the Integration Runtime node, you should see a similar view:

    Check Integration Runtime node status
  8. Go back to Azure Portal and finish adding new Integration Runtime. You should see it was successfully added:

    Integration Runtime status
  9. Go to Linked services section and create a new Linked service based on ODBC:

    Add new Linked service
  10. Select "ODBC" service:

    Add new ODBC service
  11. Configure new ODBC service. Use the same DSN name we used in the previous step and copy it to Connection string box:

    GoogleSheetsDSN
    DSN=GoogleSheetsDSN
    Configure new ODBC service
  12. For created ODBC service create ODBC-based dataset:

    Add new ODBC dataset
  13. Go to your pipeline and add Copy data connector into the flow. In Source section use OdbcDataset we created as a source dataset:

    Set source in Copy data
  14. Then go to Sink section and select a destination/sink dataset. In this example we use precreated AzureBlobStorageDataset which saves data into an Azure Blob:

    Set sink in Copy data
  15. Finally, run the pipeline and see data being transferred from OdbcDataset to your destination dataset:

    Run the flow

Advanced topics

Create Custom Stored Procedure in ZappySys Driver

You can create procedures to encapsulate custom logic and then only pass handful parameters rather than long SQL to execute your API call.

Steps to create Custom Stored Procedure in ZappySys Driver. You can insert Placeholders anywhere inside Procedure Body. Read more about placeholders here

  1. Go to Custom Objects Tab and Click on Add button and Select Add Procedure:
    ZappySys Driver - Add Stored Procedure

  2. Enter the desired Procedure name and click on OK:
    ZappySys Driver - Add Stored Procedure Name

  3. Select the created Stored Procedure and write the your desired stored procedure and Save it and it will create the custom stored procedure in the ZappySys Driver:
    Here is an example stored procedure for ZappySys Driver. You can insert Placeholders anywhere inside Procedure Body. Read more about placeholders here

    CREATE PROCEDURE [usp_get_orders]
        @fromdate = '<<yyyy-MM-dd,FUN_TODAY>>'
     AS
        SELECT * FROM Orders where OrderDate >= '<@fromdate>';
    

    ZappySys Driver - Create Custom Stored Procedure

  4. That's it now go to Preview Tab and Execute your Stored Procedure using Exec Command. In this example it will extract the orders from the date 1996-01-01:

    Exec usp_get_orders '1996-01-01';

    ZappySys Driver - Execute Custom Stored Procedure

  5. Let's generate the SQL Server Query Code to make the API call using stored procedure. Go to Code Generator Tab, select language as SQL Server and click on Generate button the generate the code.
    As we already created the linked server for this Data Source, in that you just need to copy the Select Query and need to use the linked server name which we have apply on the place of [MY_API_SERVICE] placeholder.

    SELECT * FROM OPENQUERY([MY_API_SERVICE], 'EXEC usp_get_orders @fromdate=''1996-07-30''')

    ZappySys Driver - Generate SQL Server Query

  6. Now go to SQL served and execute that query and it will make the API call using stored procedure and provide you the response.
    ZappySys Driver - Generate SQL Server Query

Create Custom Virtual Table in ZappySys Driver

ZappySys API Drivers support flexible Query language so you can override Default Properties you configured on Data Source such as URL, Body. This way you don't have to create multiple Data Sources if you like to read data from multiple EndPoints. However not every application support supplying custom SQL to driver so you can only select Table from list returned from driver.

If you're dealing with Microsoft Access and need to import data from an SQL query, it's important to note that Access doesn't allow direct import of SQL queries. Instead, you can create custom objects (Virtual Tables) to handle the import process.

Many applications like MS Access, Informatica Designer wont give you option to specify custom SQL when you import Objects. In such case Virtual Table is very useful. You can create many Virtual Tables on the same Data Source (e.g. If you have 50 URLs with slight variations you can create virtual tables with just URL as Parameter setting.

  1. Go to Custom Objects Tab and Click on Add button and Select Add Table:
    ZappySys Driver - Add Table

  2. Enter the desired Table name and click on OK:
    ZappySys Driver - Add Table Name

  3. And it will open the New Query Window Click on Cancel to close that window and go to Custom Objects Tab.

  4. Select the created table, Select Text Type AS SQL and write the your desired SQL Query and Save it and it will create the custom table in the ZappySys Driver:
    Here is an example SQL query for ZappySys Driver. You can insert Placeholders also. Read more about placeholders here

    SELECT
      "ShipCountry",
      "OrderID",
      "CustomerID",
      "EmployeeID",
      "OrderDate",
      "RequiredDate",
      "ShippedDate",
      "ShipVia",
      "Freight",
      "ShipName",
      "ShipAddress",
      "ShipCity",
      "ShipRegion",
      "ShipPostalCode"
    FROM "Orders"
    Where "ShipCountry"='USA'

    ZappySys Driver - Create Custom Table

  5. That's it now go to Preview Tab and Execute your custom virtual table query. In this example it will extract the orders for the USA Shipping Country only:

    SELECT * FROM "vt__usa_orders_only"

    ZappySys Driver - Execute Custom Virtual Table Query

  6. Let's generate the SQL Server Query Code to make the API call using stored procedure. Go to Code Generator Tab, select language as SQL Server and click on Generate button the generate the code.
    As we already created the linked server for this Data Source, in that you just need to copy the Select Query and need to use the linked server name which we have apply on the place of [MY_API_SERVICE] placeholder.

    SELECT * FROM OPENQUERY([MY_API_SERVICE], 'EXEC [usp_get_orders] ''1996-01-01''')

    ZappySys Driver - Generate SQL Server Query

  7. Now go to SQL served and execute that query and it will make the API call using stored procedure and provide you the response.
    ZappySys Driver - Generate SQL Server Query

Actions supported by Google Sheets Connector

Google Sheets Connector support following actions for REST API integration. If some actions are not listed below then you can easily edit Connector file and enhance out of the box functionality.
 Read Sheet Data
Read google spreadsheet data from desired tab / cell location (i.e. start/end range)    [Read more...]
Parameter Description
Range
 Clear Sheet Values
Clears values from a spreadsheet. The caller must specify the spreadsheet ID and range. Only values are cleared -- all other properties of the cell (such as formatting, data validation, etc..) are kept.    [Read more...]
Parameter Description
Range
 Delete Sheet Rows / Columns
Deletes rows / columns based on startIndex / endIndex range (Index is zero based). For example to delete First 5 rows specify startIndex=0 and endIndex=4    [Read more...]
Parameter Description
Range Type Specifies what would you like to delete (i.e. Rows or Columns)
Option Value
ROWS ROWS
COLUMNS COLUMNS
Range Start Index (starts from 0) Range Start Index (Zero based) for operation. For Column Operation translate Alpha value to zero based index. Example: Column D = Index 3. Column AA=26
Range End Index (starts from 0) Range End Index (Zero based) for operation. For Column Operation translate Alpha value to zero based index. Example: Column D = Index 3. Column AA=26
TabId Numeric ID of SpreadSheet Tab for which you like to delete rows/columns. For first tab its 0. You can find this ID from Sheet URL in browser. Get Number after edit#gid= (thats your Tab ID)
 Delete SpreadSheet Tab
Deletes specified tab from spreadsheet    [Read more...]
Parameter Description
TabId Numeric ID of SpreadSheet Tab for which you like to delete rows/columns. For first tab its 0. You can find this ID from Sheet URL in browser. Get Number after edit#gid= (thats your Tab ID)
 Create SpreadSheet Tab
Creates new tab for specified spreadsheet.    [Read more...]
Parameter Description
NewTabName Name for new Tab you like to add
InitialRowCount Initial row count for new sheet
InitialColumnCount Initial column count for new sheet
TabColorRedValue Tab Color - Red Value for RGB
TabColorGreenValue Tab Color - Green Value for RGB
TabColorBlueValue Tab Color - Blue Value for RGB
 Execute Command(s)
Perform various operations available in online editor such as copy, paste, format, merge. Add multiple JSON command by adding comma after first command (e.g. requests : [ {..cmd1..} , {..cmd2..}, {..cmd3..} ] ) Refer to example requests on help link.    [Read more...]
Parameter Description
Request Body
TabId Numeric ID of SpreadSheet Tab for which you like to delete rows/columns. For first tab its 0. You can find this ID from Sheet URL in browser. Get Number after edit#gid= (thats your Tab ID)
 Update Sheet Data (Overwrite Cells)
Update data to spreadsheet on desired tab / cell location (i.e. start/end range). Limit is 10MB per request.    [Read more...]
Parameter Description
Range for Table Boundary (Including Header) Enter Range to detect Table column names and datatypes. Example: enter A1:C if you have table of 3 columns starting from Cell A1
Range for Data Cells Cell Range which needs to be update. Example: Enter A2 if you like to start update from cell A2
 Insert Sheet Data (Append at the end)
Append data to spreadsheet on desired tab. Data is appended after last non-empty row/cell location. You can supply cell offset to start scan to find non-empty cell.    [Read more...]
Parameter Description
Start Range This is the range in which next row location is detected based on first empty cell and row (Examples: A1, A1:GR, A1:GR200). This range is also used to detect metadata. Values are appended after the last row of the table.
 Get Sheet Properties / Tab information
Read read sheet properties (e.g. list of tabs on sheet and its properties)    [Read more...]
Parameter Description
SpreadSheetId
Option Value
Enter SpreadSheet Id
Example SpreadSheet Id 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms
 Generic Request
This is generic endpoint. Use this endpoint when some actions are not implemented by connector. Just enter partial URL (Required), Body, Method, Header etc. Most parameters are optional except URL.    [Read more...]
Parameter Description
Url API URL goes here. You can enter full URL or Partial URL relative to Base URL. If it is full URL then domain name must be part of ServiceURL or part of TrustedDomains
Body Request Body content goes here
IsMultiPart Set this option if you want to upload file(s) (i.e. POST RAW file data) or send data using Multi-Part encoding method (i.e. Content-Type: multipart/form-data). Multi-Part request allows you to mix key/value and upload files in same request. On the other hand raw upload allows only single file upload (without any key/value) ==== Raw Upload (Content-Type: application/octet-stream) ===== To upload single file in raw mode check this option and specify full file path starting with @ sign in the Body (e.g. @c:\data\myfile.zip ) ==== Form-Data / Multipart Upload (Content-Type: multipart/form-data) ===== To treat your Request data as multi part fields you must specify key/value pairs separated by new lines into RequestData field (i.e. Body). Each key value pair is entered on new-line and key/value are separated using equal sign (=). Preceding and trailing spaces are ignored also blank lines are ignored. If field value has some any special character(s) then use escape sequence (e.g. For NewLine: \r\n, For Tab: \t, For at (@): \@). When value of any field starts with at sign (@) its automatically treated as File you want to upload. By default file content type is determined based on extension however you can supply content type manually for any field using this way [ YourFileFieldName.Content-Type=some-content-type ]. By default File Upload Field always includes Content-Type in the request (non file fields do not have content-type by default unless you supply manually). For some reason if you dont want to use Content-Type header in your request then supply blank Content-Type to exclude this header altogather [e.g. SomeFieldName.Content-Type= ]. In below example we have supplied Content-Type for file2 and SomeField1, all other fields are using default content-type. See below Example of uploading multiple files along with additional fields. If some API requires you to pass Content-Type: multipart/form-data rather than multipart/form-data then manually set Request Header => Content-Type: multipart/mixed (it must starts with multipart/ else will be ignored). file1=@c:\data\Myfile1.txt file2=@c:\data\Myfile2.json file2.Content-Type=application/json SomeField1=aaaaaaa SomeField1.Content-Type=text/plain SomeField2=12345 SomeFieldWithNewLineAndTab=This is line1\r\nThis is line2\r\nThis is \ttab \ttab \ttab SomeFieldStartingWithAtSign=\@MyTwitterHandle
Filter Enter filter to extract array from response. Example: $.rows[*] --OR-- $.customers[*].orders[*]. Check your response document and find out hierarchy you like to extract
Option Value
No filter
Example1 $.store.books[*]
Example2 (Sections Under Books) $.store.books[*].sections[*]
Example3 (Equals) $.store.books[?(@author=='sam')]
Example4 (Equals - Any Section) $..[?(@author=='sam')]
Example5 (Not Equals - Any Section) $..[?(@author!='sam')]
Example6 (Number less than) $.store.books[?(@.price<10)] Example7 (Regular Expression - Contains Pattern)=$.store.books[?(@author=~ /sam|bob/ )]
Example8 (Regular Expression - Does Not Contain Pattern) $.store.books[?(@author=~ /^((?!sam|bob).)*$/ )]
Example9 (Regular Expression - Exact Pattern Match) $.store.books[?(@author=~ /^sam|bob$/ )]
Example10 (Regular Expression - Starts With) $.store.books[?(@author=~ /^sam/ )]
Example11 (Regular Expression - Ends With) $.store.books[?(@author=~ /sam$/ )]
Example12 (Between) $.store.employees[?( @.hiredate>'2015-01-01' && @.hiredate<'2015-01-04' )]
Headers Headers for Request. To enter multiple headers use double pipe or new line after each {header-name}:{value} pair
 Generic Request (Bulk Write)
This is a generic endpoint for bulk write purpose. Use this endpoint when some actions are not implemented by connector. Just enter partial URL (Required), Body, Method, Header etc. Most parameters are optional except URL.    [Read more...]
Parameter Description
Url API URL goes here. You can enter full URL or Partial URL relative to Base URL. If it is full URL then domain name must be part of ServiceURL or part of TrustedDomains
IsMultiPart Set this option if you want to upload file(s) (i.e. POST RAW file data) or send data using Multi-Part encoding method (i.e. Content-Type: multipart/form-data). Multi-Part request allows you to mix key/value and upload files in same request. On the other hand raw upload allows only single file upload (without any key/value) ==== Raw Upload (Content-Type: application/octet-stream) ===== To upload single file in raw mode check this option and specify full file path starting with @ sign in the Body (e.g. @c:\data\myfile.zip ) ==== Form-Data / Multipart Upload (Content-Type: multipart/form-data) ===== To treat your Request data as multi part fields you must specify key/value pairs separated by new lines into RequestData field (i.e. Body). Each key value pair is entered on new-line and key/value are separated using equal sign (=). Preceding and trailing spaces are ignored also blank lines are ignored. If field value has some any special character(s) then use escape sequence (e.g. For NewLine: \r\n, For Tab: \t, For at (@): \@). When value of any field starts with at sign (@) its automatically treated as File you want to upload. By default file content type is determined based on extension however you can supply content type manually for any field using this way [ YourFileFieldName.Content-Type=some-content-type ]. By default File Upload Field always includes Content-Type in the request (non file fields do not have content-type by default unless you supply manually). For some reason if you dont want to use Content-Type header in your request then supply blank Content-Type to exclude this header altogather [e.g. SomeFieldName.Content-Type= ]. In below example we have supplied Content-Type for file2 and SomeField1, all other fields are using default content-type. See below Example of uploading multiple files along with additional fields. If some API requires you to pass Content-Type: multipart/form-data rather than multipart/form-data then manually set Request Header => Content-Type: multipart/mixed (it must starts with multipart/ else will be ignored). file1=@c:\data\Myfile1.txt file2=@c:\data\Myfile2.json file2.Content-Type=application/json SomeField1=aaaaaaa SomeField1.Content-Type=text/plain SomeField2=12345 SomeFieldWithNewLineAndTab=This is line1\r\nThis is line2\r\nThis is \ttab \ttab \ttab SomeFieldStartingWithAtSign=\@MyTwitterHandle
Filter Enter filter to extract array from response. Example: $.rows[*] --OR-- $.customers[*].orders[*]. Check your response document and find out hierarchy you like to extract
Headers Headers for Request. To enter multiple headers use double pipe (||) or new line after each {header-name}:{value} pair

Google Sheets Connector Examples for Azure Data Factory (Pipeline) Connection

This page offers a collection of SQL examples designed for seamless integration with the ZappySys API ODBC Driver under ODBC Data Source (36/64) or ZappySys Data Gateway, enhancing your ability to connect and interact with Prebuilt Connectors effectively.

Query from default Spreadsheet    [Read more...]

Gets data from Tab name Sheet1 from SpreadSheet Id defined in the connection

SELECT * FROM [Sheet1]

Query from User defined Spreadsheet    [Read more...]

Gets data from Tab name 'Class Data' from user defined SpreadSheet Id

SELECT * FROM [Class Data] WITH(SpreadSheetId='1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms')

Query from custom cell range    [Read more...]

In this example we query Tab name 'Class Data' and we are reading Range 'A4:GR'.

SELECT * FROM [Class Data]
WITH(
	  Range='A4:GR'  --cell range you like to query
	, ArrayTransEnableCustomColumns='False' --do not treat first row in range as Column Names
	, SpreadSheetId='1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms'  --enter sheet id you like to query. Comment this if you like to use default ID defined in the connection
)

Query from custom cell range    [Read more...]

In this example we query Tab name 'Class Data' and we are reading Range 'A4:GR'.

UPDATE [Sheet1]
SET Col1='data-1', Col2=100, Col3='2020-01-31' --column names are ignored. Values are sent in the same order you supply and writtern to start cell specified by WriteRange
WITH(
	, WriteRange='G9' --start writing from here
	, SpreadSheetId='1az2H8ZYk7BvjddVTqPR-LfDjX9IRpIpjCDpFPe9EzkU' --comment this to use default Sheet Id from connection setting
)

Update Multiple Rows in Sheet from CSV file    [Read more...]

In this example we query CSV file as Source (Using ZapyySys CSV ODBC Driver) and updating Google Sheet in BULK.

UPDATE [Sheet1]
SOURCE(
 'ODBC',  --driver type ODBC | MSSQL | OLEDB
 'Driver={ZappySys CSV Driver};', --connection string for driver
 'SELECT * FROM $ WITH (SRC=''c:\data.csv'') ' --sql query for source data
)
WITH(
  WriteRange='G9', SpreadSheetId='1az2H8ZYk7BvjddVTqPR-LfDjX9IRpIpjCDpFPe9EzkU' --comment this to use default Sheet Id from connection setting 
)

Update Values Vertically (Column Mode)    [Read more...]

In this example we will write value as columns rather than row.

UPDATE [Sheet1]
SET Col1='Jan',Col2='Feb',Col3='Mar'
WITH(
  WriteRange='G9', 
  SpreadSheetId='1az2H8ZYk7BvjddVTqPR-LfDjX9IRpIpjCDpFPe9EzkU', --comment this to use default Sheet Id from connection setting
  MajorDimension='COLUMNS' --write values vertical rather horizontal
)

Insert Data in Sheet1    [Read more...]

Insert row to tab name Sheet1 in SheetId defined in connection

INSERT INTO "Sheet1"("MyStringCol", "MyIntegerCol", "MyDateCol", "MyDecimalCol") VALUES('AAA',100,'2020-01-01',150.33)

Insert Multiple Rows in Sheet1 from CSV file    [Read more...]

In this example we query CSV file as Source (Using ZapyySys CSV ODBC Driver) and updating Google Sheet in BULK.

INSERT INTO [Sheet1]
SOURCE(
 'ODBC', --driver type ODBC | MSSQL | OLEDB
 'Driver={ZappySys CSV Driver};', --connection string for driver
 'SELECT * FROM $ WITH (SRC=''c:\temp\dump.txt'') ' --sql query for source data
)
WITH(
  Range='G9', SpreadSheetId='1az2H8ZYk7BvjddVTqPR-LfDjX9IRpIpjCDpFPe9EzkU' --comment this to use default Sheet Id from connection setting 
)

Write Values Vertically (Column Mode)    [Read more...]

In this example we will write value as columns rather than row.

INSERT INTO [Sheet1](Col1,Col2,Col3) 
VALUES('Jan','Feb','Mar')
WITH(
  Range='G9', --starting cell to write data
  SpreadSheetId='1az2H8ZYk7BvjddVTqPR-LfDjX9IRpIpjCDpFPe9EzkU', --comment this to use default Sheet Id from connection setting
  MajorDimension='COLUMNS' --write values vertical rather horizontal
)

Execute Action (i.e. Delete Rows / Columns)    [Read more...]

This example shows how to execute various commands for sheet (i.e. copy, paste, formatting, delete, merge etc). In this example we are executing delete comamnds (i.e. deleteDimension commands). Notice we called same command twice becuase we want to delete two ranges (index 10-20 and 50-60). You can execute any valid command available by Google Sheets API. Here are some good examples of formatting commands https://developers.google.com/sheets/api/samples/formatting

SELECT * FROM batch_update_request
WITH(
	  Body='{
  "requests": [
    {
      "deleteDimension": {
        "range": {
          "sheetId": 0,
          "dimension": "ROWS",
          "startIndex": 10,
          "endIndex": 20
        }
      }
    } ,
    
   {
      "deleteDimension": {
        "range": {
          "sheetId": 0,
          "dimension": "ROWS",
          "startIndex": 50,
          "endIndex": 60
        }
      }
    }
    
  ]
}'
	, TabId='0' -- tab internal id (use UI to get this). 0 means first tab. Or check URL in browser and see at the end of URL #gid=xxxxxxx where xxxxxx is your tab id
	, SpreadSheetId='1az2H8ZYk7BvjddVTqPR-LfDjX9IRpIpjCDpFPe9EzkU' --comment this to use default Sheet Id from connection setting
)

Conclusion

In this article we discussed how to connect to Google Sheets in Azure Data Factory (Pipeline) and integrate data without any coding. Click here to Download Google Sheets Connector for Azure Data Factory (Pipeline) and try yourself see how easy it is. If you still have any question(s) then ask here or simply click on live chat icon below and ask our expert (see bottom-right corner of this page).

Download Google Sheets Connector for Azure Data Factory (Pipeline) Documentation 

More integrations

Other application integration scenarios for Google Sheets

Other connectors for Azure Data Factory (Pipeline)


Download Google Sheets Connector for Azure Data Factory (Pipeline) Documentation

  • How to connect Google Sheets in Azure Data Factory (Pipeline)?

  • How to get Google Sheets data in Azure Data Factory (Pipeline)?

  • How to read Google Sheets data in Azure Data Factory (Pipeline)?

  • How to load Google Sheets data in Azure Data Factory (Pipeline)?

  • How to import Google Sheets data in Azure Data Factory (Pipeline)?

  • How to pull Google Sheets data in Azure Data Factory (Pipeline)?

  • How to push data to Google Sheets in Azure Data Factory (Pipeline)?

  • How to write data to Google Sheets in Azure Data Factory (Pipeline)?

  • How to POST data to Google Sheets in Azure Data Factory (Pipeline)?

  • Call Google Sheets API in Azure Data Factory (Pipeline)

  • Consume Google Sheets API in Azure Data Factory (Pipeline)

  • Google Sheets Azure Data Factory (Pipeline) Automate

  • Google Sheets Azure Data Factory (Pipeline) Integration

  • Integration Google Sheets in Azure Data Factory (Pipeline)

  • Consume real-time Google Sheets data in Azure Data Factory (Pipeline)

  • Consume real-time Google Sheets API data in Azure Data Factory (Pipeline)

  • Google Sheets ODBC Driver | ODBC Driver for Google Sheets | ODBC Google Sheets Driver | SSIS Google Sheets Source | SSIS Google Sheets Destination

  • Connect Google Sheets in Azure Data Factory (Pipeline)

  • Load Google Sheets in Azure Data Factory (Pipeline)

  • Load Google Sheets data in Azure Data Factory (Pipeline)

  • Read Google Sheets data in Azure Data Factory (Pipeline)

  • Google Sheets API Call in Azure Data Factory (Pipeline)