Endpoint List Folders
Name
list_folders
Description
Parameters
| Parameter | Required | Options | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Name:
Label: Drive Id Specify a drive |
YES | |||||||||||||||||||||
|
Name:
Label: Record Filter (Client Side) |
|
|||||||||||||||||||||
|
Name:
Label: Site Id (Re-Select Drive Id after you change this) Specify a site |
||||||||||||||||||||||
|
Name:
Label: Search Type (i.e. Recursive -OR- Non-Recursive) - Default=Recursive) NOTE: Not Supported with Application Credentials which uses Sites.Selected Scope. If you do not wish to see files from child folders then use Non-Recursive option. Recursive option has certain limitations (e.g. Only indexed files will appear so it takes time to show up in the list). If you do not see some files listed in the output then use Non-Recursive option (must specify Parent Folder Path in SearchPath property). |
|
|||||||||||||||||||||
|
Name:
Label: Search Path (Default=Root Folder) - Max 200 items listed |
||||||||||||||||||||||
|
Name:
Label: Order By Field(s) - Only for Recursive SearchType Order by Field(s) for output. You can order by single or multiple fields and use filed suffix asc for ascending and desc for descending order. For example to order by lastModifiedDateTime in descending order use lastModifiedDateTime desc. To order by nested field you can supply lastModifiedBy/user/email asc |
|
Output Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description |
|---|---|---|---|---|
| id |
DT_WSTR
|
nvarchar(500)
|
500 | |
| name |
DT_WSTR
|
nvarchar(150)
|
150 | |
| size |
DT_I8
|
bigint
|
||
| createdDateTime |
DT_DBTIMESTAMP
|
datetime
|
||
| lastModifiedDateTime |
DT_DBTIMESTAMP
|
datetime
|
||
| webUrl |
DT_WSTR
|
nvarchar(1500)
|
1500 | |
| webUrlPath |
DT_WSTR
|
nvarchar(1500)
|
1500 | |
| createdBy_user_id |
DT_WSTR
|
nvarchar(200)
|
200 | |
| createdBy_user_email |
DT_WSTR
|
nvarchar(150)
|
150 | |
| createdBy_user_displayName |
DT_WSTR
|
nvarchar(100)
|
100 | |
| createdBy_application_id |
DT_WSTR
|
nvarchar(200)
|
200 | |
| createdBy_application_displayName |
DT_WSTR
|
nvarchar(100)
|
100 | |
| lastModifiedBy_user_id |
DT_WSTR
|
nvarchar(200)
|
200 | |
| lastModifiedBy_user_email |
DT_WSTR
|
nvarchar(150)
|
150 | |
| lastModifiedBy_user_displayName |
DT_WSTR
|
nvarchar(150)
|
150 | |
| lastModifiedBy_application_id |
DT_WSTR
|
nvarchar(200)
|
200 | |
| lastModifiedBy_application_displayName |
DT_WSTR
|
nvarchar(150)
|
150 | |
| parentReference_id |
DT_WSTR
|
nvarchar(200)
|
200 | |
| parentReference_driveId |
DT_WSTR
|
nvarchar(400)
|
400 | |
| parentReference_driveType |
DT_WSTR
|
nvarchar(100)
|
100 | |
| parentReference_name |
DT_WSTR
|
nvarchar(200)
|
200 | This is only returned when calling lookup or /children call (e.g. /items/root:/[folder-name] OR /items/[item-id] ) |
| parentReference_siteId |
DT_WSTR
|
nvarchar(200)
|
200 | |
| parentReference_path |
DT_WSTR
|
nvarchar(1000)
|
1000 | This is only returned when calling lookup or /children call (e.g. /items/root:/[folder-name] OR /items/[item-id] ) |
| fileSystemInfo_createdDateTime |
DT_DBTIMESTAMP
|
datetime
|
||
| fileSystemInfo_lastModifiedDateTime |
DT_DBTIMESTAMP
|
datetime
|
||
| folder_childCount |
DT_I8
|
bigint
|
||
| file_mimeType |
DT_WSTR
|
nvarchar(300)
|
300 | |
| file_quickXorHash |
DT_WSTR
|
nvarchar(200)
|
200 | |
| file_sha1Hash |
DT_WSTR
|
nvarchar(200)
|
200 | |
| file_sha256Hash |
DT_WSTR
|
nvarchar(200)
|
200 | |
| shared_scope |
DT_WSTR
|
nvarchar(100)
|
100 | |
| remoteItem_parentReference_id |
DT_WSTR
|
nvarchar(200)
|
200 | |
| remoteItem_parentReference_driveId |
DT_WSTR
|
nvarchar(400)
|
400 | |
| remoteItem_parentReference_driveType |
DT_WSTR
|
nvarchar(100)
|
100 | |
| remoteItem_parentReference_name |
DT_WSTR
|
nvarchar(200)
|
200 | |
| remoteItem_parentReference_siteId |
DT_WSTR
|
nvarchar(200)
|
200 | |
| remoteItem_parentReference_path |
DT_WSTR
|
nvarchar(1000)
|
1000 | |
| remoteItem_shared_scope |
DT_WSTR
|
nvarchar(100)
|
100 | |
| remoteItem_shared_sharedDateTime |
DT_DBTIMESTAMP
|
datetime
|
||
| remoteItem_sharedBy_user_id |
DT_WSTR
|
nvarchar(200)
|
200 | |
| remoteItem_sharedBy_user_email |
DT_WSTR
|
nvarchar(150)
|
150 | |
| remoteItem_sharedBy_user_displayName |
DT_WSTR
|
nvarchar(150)
|
150 | |
| remoteItem_sharepointIds_listId |
DT_WSTR
|
nvarchar(200)
|
200 | |
| remoteItem_sharepointIds_listItemId |
DT_WSTR
|
nvarchar(200)
|
200 | |
| remoteItem_sharepointIds_listItemUniqueId |
DT_WSTR
|
nvarchar(200)
|
200 | |
| remoteItem_sharepointIds_siteId |
DT_WSTR
|
nvarchar(200)
|
200 | |
| remoteItem_sharepointIds_siteUrl |
DT_WSTR
|
nvarchar(200)
|
200 | |
| remoteItem_sharepointIds_tenantId |
DT_WSTR
|
nvarchar(200)
|
200 | |
| remoteItem_sharepointIds_webId |
DT_WSTR
|
nvarchar(200)
|
200 | |
| id_path |
DT_WSTR
|
nvarchar(500)
|
500 | |
| folder_path |
DT_WSTR
|
nvarchar(500)
|
500 |
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 SharePoint Online Connector in API Source or in API Destination SSIS Data Flow components to read or write data.
API Source
| Required Parameters | |
|---|---|
| Drive Id | Fill-in the parameter... |
| Optional Parameters | |
| Record Filter (Client Side) | |
| Site Id (Re-Select Drive Id after you change this) | |
| Search Type (i.e. Recursive -OR- Non-Recursive) - Default=Recursive) | search(q='') |
| Search Path (Default=Root Folder) - Max 200 items listed | /root |
| Order By Field(s) - Only for Recursive SearchType | |
API Destination
| Required Parameters | |
|---|---|
| Drive Id | Fill-in the parameter... |
| Optional Parameters | |
| Record Filter (Client Side) | |
| Site Id (Re-Select Drive Id after you change this) | |
| Search Type (i.e. Recursive -OR- Non-Recursive) - Default=Recursive) | search(q='') |
| Search Path (Default=Root Folder) - Max 200 items listed | /root |
| Order By Field(s) - Only for Recursive SearchType | |
ODBC application
Use these SQL queries in your ODBC application data source:
List folders
<p>Gets all folders from a specific drive (document library).</p>
SELECT * FROM list_folders
WITH (
-- Drive (SharePoint Document Library)
DriveId='b!GtLN726LE0eY5F2BBNi14wMKmwdpCDFMn1d71ra11GuQ4DORpHy-XXXXXXXXXXXXX')
--You can get DriveId by selecting from 'Drives' table.
List folders in a parent folder
<p>Gets folders within a specific parent folder in a document library. You can filter by path or ID.</p>
SELECT * FROM list_folders
WITH (
-- Drive (SharePoint Document Library)
DriveId='b!GtLN726LE0eY5F2BBNi14wMKmwdpCDFMn1d71ra11GuQ4DORpHy-XXXXXXXXXXXXX'
, SearchPath='/items/01SUOJPKA3E3JKEBRLFRBYGIPBARUP3A2R' --enter parent folder id in search path
--OR--
--, SearchPath='/root:/myfolder/subfolder:' --You may also use parent folder path rather than id like this under which you like to search
--exclude self: enter parent folder id to exclude from the list
, Filter='$.value[?(@.folder.childCount !=null && @id!=''01SUOJPKA3E3JKEBRLFRBYGIPBARUP3A2R'')]'
)
--You can get DriveId by selecting from 'Drives' table.
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
List folders
<p>Gets all folders from a specific drive (document library).</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM list_folders
WITH (
-- Drive (SharePoint Document Library)
DriveId=''b!GtLN726LE0eY5F2BBNi14wMKmwdpCDFMn1d71ra11GuQ4DORpHy-XXXXXXXXXXXXX'')
--You can get DriveId by selecting from ''Drives'' table.';
EXEC (@MyQuery) AT [LS_TO_SHAREPOINT_ONLINE_IN_GATEWAY];
List folders in a parent folder
<p>Gets folders within a specific parent folder in a document library. You can filter by path or ID.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM list_folders
WITH (
-- Drive (SharePoint Document Library)
DriveId=''b!GtLN726LE0eY5F2BBNi14wMKmwdpCDFMn1d71ra11GuQ4DORpHy-XXXXXXXXXXXXX''
, SearchPath=''/items/01SUOJPKA3E3JKEBRLFRBYGIPBARUP3A2R'' --enter parent folder id in search path
--OR--
--, SearchPath=''/root:/myfolder/subfolder:'' --You may also use parent folder path rather than id like this under which you like to search
--exclude self: enter parent folder id to exclude from the list
, Filter=''$.value[?(@.folder.childCount !=null && @id!=''''01SUOJPKA3E3JKEBRLFRBYGIPBARUP3A2R'''')]''
)
--You can get DriveId by selecting from ''Drives'' table.';
EXEC (@MyQuery) AT [LS_TO_SHAREPOINT_ONLINE_IN_GATEWAY];