Endpoint Export a file
Name
export_file
Description
Export a document editor files such document, Spreadsheets, Drawings, Presentations, Apps Scripts to common file formats as defined in this link https://developers.google.com/drive/api/guides/ref-export-formats [API reference]
Parameters
Parameter | Required | Options | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Name:
Label: File Id Id of a file you want to export and file must be editor type (e.g. document, Spreadsheets, Drawings, Presentations, Apps Scripts) |
YES | |||||||||||||||||||||||||||||||||||||||
Name:
Label: Export As (Mime Type) The MIME type of the format requested for this export. |
YES |
|
||||||||||||||||||||||||||||||||||||||
Name:
Label: Drive Type Default search context is User's drive. Bodies of items (files/documents) to which the query applies. Supported bodies are 'user', 'domain', 'drive', and 'allDrives'. Prefer 'user' or 'drive' to 'allDrives' for efficiency. By default, corpora is set to 'user'. However, this can change depending on the filter set through the 'Query' parameter. |
YES |
|
||||||||||||||||||||||||||||||||||||||
Name:
Label: fields fields |
||||||||||||||||||||||||||||||||||||||||
Name:
Label: Shared DriveId By default file lists from MyDrive but if you like to search other Shared drive (formally known as Team drive) then set this parameter. |
||||||||||||||||||||||||||||||||||||||||
Name:
Label: Supports all drives (e.g. My and Shared) Whether the requesting application supports both My Drives and shared drives. |
|
Output Columns
Label | Data Type (SSIS) | Data Type (SQL) | Length | Description |
---|---|---|---|---|
Status |
DT_WSTR
|
nvarchar(4000)
|
4000 |
Input Columns
Label | Data Type (SSIS) | Data Type (SQL) | Length | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime. |
Examples
SSIS
Use Google Drive Connector in API Source or in API Destination SSIS Data Flow components to read or write data.
API Source
Required Parameters | |
---|---|
File Id | Fill-in the parameter... |
Export As (Mime Type) | Fill-in the parameter... |
Overwrite Mode | Fill-in the parameter... |
Local File Path | Fill-in the parameter... |
Optional Parameters | |
fields | True |
RequestTimeoutMs | 7200000 |
SaveContentAsBinary | True |
RawOutputDataRowTemplate | {Status:'Downloaded'} |
EnableRawOutputModeSingleRow | True |

API Destination
Required Parameters | |
---|---|
File Id | Fill-in the parameter... |
Export As (Mime Type) | Fill-in the parameter... |
Overwrite Mode | Fill-in the parameter... |
Local File Path | Fill-in the parameter... |
Optional Parameters | |
fields | True |
RequestTimeoutMs | 7200000 |
SaveContentAsBinary | True |
RawOutputDataRowTemplate | {Status:'Downloaded'} |
EnableRawOutputModeSingleRow | True |

ODBC application
Use these SQL queries in your ODBC application data source:
Export Google Sheet to Excel (xlsx) or PDF
Export a Google files to other format (e.g. Google Sheets to MS Excel / PDF)
SELECT "Status" FROM export_file
WITH(
Id='1j0HFOP4gsoE-Zbf2xN3IsPSj8wgwNtIfyyvM1_BWkW4' --//google sheet id or document ID
--,DriveId='xx your shared drive id' --get id from select * from SharedDrives
--,DriveType='drive'
, ExportAs='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
--, ExportAs='application/pdf'
, ResponseDataFile='c:\temp\sheet1.xlsx'
, FileOverwriteMode='AlwaysOverwrite' -- or try 'FailIfExists' or 'SkipIfExists'
))
--You can export files from 'export_file' endpoint
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Export Google Sheet to Excel (xlsx) or PDF
Export a Google files to other format (e.g. Google Sheets to MS Excel / PDF)
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT "Status" FROM export_file
WITH(
Id=''1j0HFOP4gsoE-Zbf2xN3IsPSj8wgwNtIfyyvM1_BWkW4'' --//google sheet id or document ID
--,DriveId=''xx your shared drive id'' --get id from select * from SharedDrives
--,DriveType=''drive''
, ExportAs=''application/vnd.openxmlformats-officedocument.spreadsheetml.sheet''
--, ExportAs=''application/pdf''
, ResponseDataFile=''c:\temp\sheet1.xlsx''
, FileOverwriteMode=''AlwaysOverwrite'' -- or try ''FailIfExists'' or ''SkipIfExists''
))
--You can export files from ''export_file'' endpoint';
EXEC (@MyQuery) AT [LS_TO_GOOGLE_DRIVE_IN_GATEWAY];