Reference

Endpoint List files / folders from a parent folder (Recursive)


Name

list_parent_items

Description

List files or folders under a specified parent folder

Parameters

Parameter Required Options
Name: DriveType

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
Option Value
My Drive user
Shared Drive drive
All Drives allDrives
Name: Query

Label: Extra Query (must start with ' and ' --OR-- ' or ')

Data filter (e.g. somecolumn -eq 'somevalue' ) , User can select multiple filter criteria using 'AND','OR' operator , Note*:- please refer the link for more filter criteria : https://zappysys.com/links?url=https://developers.google.com/drive/api/guides/search-files
Option Value
None
By name (exact name match) and name='abc'
By name (contains sub string) and name contains 'abc'
By name (does not contain) and not name contains 'abc'
By text (search inside file) and fullText contains 'abc'
By created time and createdTime > '2012-06-04T12:00:00'
By modified time and modifiedTime > '2012-06-04T12:00:00'
Allow only shared files and folders and sharedWithMe=true
Exclude App Script and mimeType!='application/vnd.google-apps.script'
Search for spreadsheet and mimeType = 'application/vnd.google-apps.spreadsheet'
Search for multiple files type and mimeType contains 'application/vnd.google-apps.spreadsheet' OR mimeType contains 'application/vnd.google-apps.document' OR mimeType contains 'application/vnd.google-apps.presentation' OR mimeType contains 'application/vnd.google-apps.drawing'
Name: FolderId

Label: Search under Folder Id (Keep Blank for all folders)

Folder Id for which you like to list all files
Name: IncludeFromTrash

Label: Include files from trash

Option Value
false false
true true
Name: ItemType

Label: Search Item type (i.e. files or folders)

Option Value
all all
files files
folders folders
files_native files_native
files_exclude_native files_exclude_native
sheets sheets
documents documents
Name: DriveId

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: pageSize

Label: PageSize

Name: SupportsAllDrives

Label: Supports all drives (e.g. My and Shared)

Whether the requesting application supports both My Drives and shared drives.
Option Value
true true
false false
Name: IncludeItemsFromAllDrives

Label: Include items from all drives (e.g. My and Shared)

Option Value
true true
false false
Name: Spaces

Label: Spaces to include in corpora (comma separed)

Name: IncludePermissionsForView

Label: Include Permissions For View

Option Value
true true
false false
Name: IncludeLabels

Label: Include Labels

Option Value
true true
false false

Output Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
Id DT_WSTR nvarchar(440) 440
Kind DT_WSTR nvarchar(200) 200
Name DT_WSTR nvarchar(780) 780
MimeType DT_WSTR nvarchar(650) 650
CreatedTime DT_DBTIMESTAMP datetime
ModifiedTime DT_DBTIMESTAMP datetime
Size DT_WSTR nvarchar(200) 200
Version DT_WSTR nvarchar(200) 200
Shared DT_BOOL bit
Starred DT_BOOL bit
Trashed DT_BOOL bit
FileExtension DT_WSTR nvarchar(200) 200
DriveId DT_WSTR nvarchar(500) 500
CopyRequiresWriterPermission DT_BOOL bit
Md5Checksum DT_WSTR nvarchar(500) 500
WritersCanShare DT_BOOL bit
ViewedByMe DT_BOOL bit
Parents DT_WSTR nvarchar(500) 500
ThumbnailLink DT_WSTR nvarchar(4000) 4000
IconLink DT_WSTR nvarchar(1000) 1000
LastModifyingUserDisplayName DT_WSTR nvarchar(500) 500
LastModifyingUserKind DT_WSTR nvarchar(100) 100
LastModifyingUserMe DT_BOOL bit
LastModifyingUserPermissionId DT_WSTR nvarchar(500) 500
LastModifyingUserEmailAddress DT_WSTR nvarchar(500) 500
LastModifyingUserPhotoLink DT_WSTR nvarchar(1000) 1000
Owners DT_WSTR nvarchar(4000) 4000
HeadRevisionId DT_WSTR nvarchar(1000) 1000
WebViewLink DT_WSTR nvarchar(1000) 1000
WebContentLink DT_WSTR nvarchar(1000) 1000
ViewersCanCopyContent DT_BOOL bit
Permissions DT_WSTR nvarchar(4000) 4000
HasThumbnail DT_BOOL bit
Spaces DT_WSTR nvarchar(500) 500
ExplicitlyTrashed DT_BOOL bit
ModifiedByMeTime DT_DBTIMESTAMP datetime
ViewedByMeTime DT_DBTIMESTAMP datetime
QuotaBytesUsed DT_WSTR nvarchar(50) 50
OriginalFilename DT_WSTR nvarchar(500) 500
OwnedByMe DT_BOOL bit
FullFileExtension DT_WSTR nvarchar(50) 50
IsAppAuthorized DT_BOOL bit
CanChangeViewersCanCopyContent DT_BOOL bit
CanEdit DT_BOOL bit
CanCopy DT_BOOL bit
CanComment DT_BOOL bit
CanAddChildren DT_BOOL bit
CanDelete DT_BOOL bit
CanDownload DT_BOOL bit
CanListChildren DT_BOOL bit
CanRemoveChildren DT_BOOL bit
CanRename DT_BOOL bit
CanTrash DT_BOOL bit
CanReadRevisions DT_BOOL bit
CanChangeCopyRequiresWriterPermission DT_BOOL bit
CanMoveItemIntoTeamDrive DT_BOOL bit
CanUntrash DT_BOOL bit
CanModifyContent DT_BOOL bit
CanMoveItemOutOfDrive DT_BOOL bit
CanAddMyDriveParent DT_BOOL bit
CanRemoveMyDriveParent DT_BOOL bit
CanMoveItemWithinDrive DT_BOOL bit
CanShare DT_BOOL bit
CanMoveChildrenWithinDrive DT_BOOL bit
CanModifyContentRestriction DT_BOOL bit
CanChangeSecurityUpdateEnabled DT_BOOL bit
CanAcceptOwnership DT_BOOL bit
CanReadLabels DT_BOOL bit
CanModifyLabels DT_BOOL bit
CanModifyEditorContentRestriction DT_BOOL bit
CanModifyOwnerContentRestriction DT_BOOL bit
CanRemoveContentRestriction DT_BOOL bit
CanMoveChildrenOutOfDrive DT_BOOL bit
CanReadDrive DT_BOOL bit
CanReadTeamDrive DT_BOOL bit
CanMoveTeamDriveItem DT_BOOL bit
CanMoveItemWithinTeamDrive DT_BOOL bit
CanMoveItemOutOfTeamDrive DT_BOOL bit
CanDeleteChildren DT_BOOL bit
CanMoveChildrenOutOfTeamDrive DT_BOOL bit
CanMoveChildrenWithinTeamDrive DT_BOOL bit
CanTrashChildren DT_BOOL bit
CanAddFolderFromAnotherDrive DT_BOOL bit
ThumbnailVersion DT_WSTR nvarchar(50) 50
ModifiedByMe DT_BOOL bit
PermissionIds DT_WSTR nvarchar(500) 500
ImageMediaMetadataWidth DT_I4 int
ImageMediaMetadataHeight DT_I4 int
ImageMediaMetadataRotation DT_I4 int
LinkShareMetadataSecurityUpdateEligible DT_BOOL bit
LinkShareMetadataSecurityUpdateEnabled DT_BOOL bit
Sha1Checksum DT_WSTR nvarchar(500) 500
Sha256Checksum DT_WSTR nvarchar(1000) 1000
HasAugmentedPermissions DT_BOOL bit
If the column you are looking for is missing, consider customizing Google Drive Connector.

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

API Source - Google Drive
Read / write Google Drive data inside your app; perform many Google Drive operations without coding, just using easy to use high performance API Connector for Google Drive
Google Drive
List files / folders from a parent folder (Recursive)
Optional Parameters
Extra Query (must start with ' and ' --OR-- ' or ')
Search under Folder Id (Keep Blank for all folders)
Include files from trash false
Search Item type (i.e. files or folders) all
SSIS API Source - Read from table or endpoint

API Destination

API Destination - Google Drive
Read / write Google Drive data inside your app; perform many Google Drive operations without coding, just using easy to use high performance API Connector for Google Drive
Google Drive
List files / folders from a parent folder (Recursive)
Optional Parameters
Extra Query (must start with ' and ' --OR-- ' or ')
Search under Folder Id (Keep Blank for all folders)
Include files from trash false
Search Item type (i.e. files or folders) all
SSIS API Destination - Access table or endpoint

ODBC application

Use these SQL queries in your ODBC application data source:

List / search items (files/folders) from a parent folder in recursive or non-recursive mode

This example shows how to list files from a parent folder, optionally you can specifiy item types to list (e.g. files, folders, sheets, documents). If you do not specify FolderId then recursive list is returned.

SELECT * FROM list_parent_items
WITH(
	--Parent folder id (Keep it blank to scan all files in all folders - recursive
	  FolderId='1VK5NBhuOTaLEy1pBMsQtG672vrJNgxai'
	
	--List only from Trash (deleted files)
	, IncludeFromTrash='false'
	
	--Extra search criteria
	--, Query='or (name contains ''blog'') or (name contains ''test'') ' --extra query
	
	--Item type to return (default is all)
	--, ItemType='files'	-- (default=all) all, files, folders, sheets, documents, files_native, files_exclude_native
	--, ItemType='folders'
	--, ItemType='sheets'
	--, ItemType='files_native'
)

SQL Server

Use these SQL queries in SQL Server after you create a data source in Data Gateway:

List / search items (files/folders) from a parent folder in recursive or non-recursive mode

This example shows how to list files from a parent folder, optionally you can specifiy item types to list (e.g. files, folders, sheets, documents). If you do not specify FolderId then recursive list is returned.

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM list_parent_items
WITH(
	--Parent folder id (Keep it blank to scan all files in all folders - recursive
	  FolderId=''1VK5NBhuOTaLEy1pBMsQtG672vrJNgxai''
	
	--List only from Trash (deleted files)
	, IncludeFromTrash=''false''
	
	--Extra search criteria
	--, Query=''or (name contains ''''blog'''') or (name contains ''''test'''') '' --extra query
	
	--Item type to return (default is all)
	--, ItemType=''files''	-- (default=all) all, files, folders, sheets, documents, files_native, files_exclude_native
	--, ItemType=''folders''
	--, ItemType=''sheets''
	--, ItemType=''files_native''
)';

EXEC (@MyQuery) AT [LS_TO_GOOGLE_DRIVE_IN_GATEWAY];