SharePoint Online ConnectorZappySys SharePoint Online Connector provide read / write capability inside your app (see list below), using these drag and drop , high performance connector you can perform many SharePoint Online operations without any coding. You can use this connector to integrate SharePoint Online data inside apps like SSIS, SQL Server or popular ETL Platforms / BI Tools/ Reporting Apps / Programming languages (i.e. Informatica, Power BI, SSRS, Excel, C#, JAVA, Python) |
Click on your App below to get started with SharePoint Online Integration
Actions supported by SharePoint Online Connector
SharePoint Online 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.Parameter | Description |
---|---|
Site Id |
|
Parameter | Description |
---|---|
Site Id (Re-Select Drive Id after you change this) |
|
Drive Id |
|
Parameter | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Record Filter (Client Side) |
|
||||||||||||||||||
Site Id (Re-Select Drive Id after you change this) |
|
||||||||||||||||||
Drive Id |
|
||||||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||||||
Search Path (Default=Root Folder) - Max 200 items listed |
|
||||||||||||||||||
Order By Field(s) - Only for Recursive SearchType |
|
Parameter | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Site Id (Re-Select Drive Id after you change this) |
|
||||||||||||||||||
Drive Id |
|
||||||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||||||
Search Path (Default=Root Folder) - Max 200 items listed |
|
||||||||||||||||||
Order By Field(s) - Only for Recursive SearchType |
|
Parameter | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Site Id (Re-Select Drive Id after you change this) |
|
||||||||||||||||||
Drive Id |
|
||||||||||||||||||
Search Type (Default=Recursive) |
|
||||||||||||||||||
Search Path (Default=Root Folder) |
|
||||||||||||||||||
Order By Field(s) - Only for Recursive SearchType |
|
Parameter | Description |
---|---|
Site Id (Re-Select Drive Id after you change this) |
|
Parameter | Description |
---|---|
Site Id (Re-Select Drive Id after you change this) |
|
Parameter | Description |
---|---|
SiteId (Re-Select ListId after you change this) |
|
ListId |
|
Expand |
|
Parameter | Description |
---|---|
SiteId (Re-Select ListId after you change this) |
|
ListId |
|
Parameter | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
SiteId (Re-Select ListId after you change this) |
|
||||||||||
ListId |
|
||||||||||
Filter |
|
Parameter | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
SiteId (Re-Select ListId after you change this) |
|
||||||||||
ListId |
|
||||||||||
Filter |
|
Parameter | Description |
---|---|
SiteId (Re-Select ListId after you change this) |
|
ListId (Re-Enter ListItemId after you change this) |
|
ListItemId |
|
Parameter | Description |
---|---|
SiteId (Re-Select ListId after you change this) |
|
ListId |
|
Parameter | Description |
---|---|
SiteId (Re-Select ListId after you change this) |
|
ListId (Re-Enter ListItemId after you change this) |
|
ListItemId |
|
Parameter | Description |
---|---|
SiteId (Re-Select ListId after you change this) |
|
ListId (Re-Enter ListItemId after you change this) |
|
ListItemId |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Site Id (Re-Select Drive Id after you change this) |
|
||||||||||||||
Drive Id |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
FileId -OR- Path |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Site Id (Re-Select Drive Id after you change this) |
|
||||||||||||||
Drive Id |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
Excel File Id or Path (e.g. root:/somefolder/myfile.xlsx: ) - Max 200 Listed |
|
||||||||||||||
Sheet Id or Name (e.g. {00xx-xxx-xx123} -OR- Sheet1 ) |
|
||||||||||||||
AutoDetectByValue |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Site Id (Re-Select Drive Id after you change this) |
|
||||||||||||||
Drive Id |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
Excel File Id or Path (e.g. root:/somefolder/myfile.xlsx: ) - Max 200 Listed |
|
||||||||||||||
Sheet Id or Name (e.g. {00xx-xxx-xx123} -OR- Sheet1 ) |
|
||||||||||||||
Range |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Site Id (Re-Select Drive Id after you change this) |
|
||||||||||||||
Drive Id |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
File Id or Path (e.g. root:/somefolder/myfile.xyz: ) - Max 1000 Listed |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Site Id (Re-Select Drive Id after you change this) |
|
||||||||||||||
Drive Id |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
File Id or Path (e.g. root:/somefolder/myfile.xyz: ) - Max 1000 Listed |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Site Id (Re-Select Drive Id after you change this) |
|
||||||||||||||
Drive Id |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
File Id or Path (e.g. root:/somefolder/myfile.xyz: ) - Max 1000 Listed |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Site Id (Re-Select Drive Id after you change this) |
|
||||||||||||||
Drive Id |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
File Id or Path (e.g. root:/somefolder/myfile.xyz: ) - Max 1000 Listed |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Site Id (Re-Select Drive Id after you change this) |
|
||||||||||||||
Drive Id |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
File Id or Path (e.g. root:/somefolder/myfile.xyz: ) - Max 1000 Listed |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Site Id (Re-Select Drive Id after you change this) |
|
||||||||||||||
Drive Id |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
File Id or Path (e.g. root:/somefolder/myfile.xyz: ) - Max 1000 Listed |
|
Parameter | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Site Id (Re-Select Drive Id after you change this) |
|
||||||||||
Drive Id |
|
||||||||||
Disk File Path (e.g. c:\somefolder\file.xlsx) |
|
||||||||||
Target File Path OR Id (e.g. file.xlsx -OR- myfolder/file.xlsx -OR- 0Zxxxx1234) |
|
||||||||||
Conflict Behavior (What to do if file exists) |
|
||||||||||
Use Source File Created/Modified DateTime rather than Uploaded Time |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Site Id (Re-Select Drive Id after you change this) |
|
||||||||||||||
Drive Id |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
File/Folder Id or Path (e.g. root:/myfolder: -OR- root:/myfolder/file.xyz: ) - Max 1000 Listed |
|
Parameter | Description |
---|---|
Site Id (Re-Select Drive Id after you change this) |
|
Drive Id |
|
File/Folder Id or Path (e.g. root:/myfolder: -OR- root:/myfolder/file.xyz: ) - Max 1000 Listed |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Operation |
|
||||||||||||||
Source Site Id (Optional - Select if different than default site) |
|
||||||||||||||
Source Drive Id |
|
||||||||||||||
Source File or Folder Id you like to move or rename |
|
||||||||||||||
Target Site Id (Optional - Select if different than source SiteId) |
|
||||||||||||||
Target DriveId (Optional - Select if different than source DriveId) |
|
||||||||||||||
Target Folder Id (e.g. 01R65Qxxxxxxx123 -OR- root) - Max 200 items listed |
|
||||||||||||||
Target Item Name (Optional for Move - e.g. Myfile.pdf or MyFolder) |
|
||||||||||||||
Source Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Source Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
Target Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Target Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
Prefer Async Operation (Enable if you get error) |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Source Site Id (Optional - Select if different than default site) |
|
||||||||||||||
Source Drive Id |
|
||||||||||||||
Source File or Folder Id you like to copy |
|
||||||||||||||
Target Site Id (Optional - Select if different than source SiteId) |
|
||||||||||||||
Target DriveId (Optional - Select if different than source DriveId) |
|
||||||||||||||
Target Folder Id (e.g. 01R65QTTRxxxxx -OR- root) |
|
||||||||||||||
Target Item Name (Optional) |
|
||||||||||||||
Source Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Source Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
Target Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Target Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
Prefer Async Operation (Enable if you get error) |
|
||||||||||||||
Conflict Behavior (What to do if file exists at target location) |
|
Parameter | Description | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Url |
|
||||||||||||||||||||||||||
Body |
|
||||||||||||||||||||||||||
IsMultiPart |
|
||||||||||||||||||||||||||
Filter |
|
||||||||||||||||||||||||||
Headers |
|
Parameter | Description |
---|---|
Url |
|
IsMultiPart |
|
Filter |
|
Headers |
|
SharePoint Online Connector Examples (For ODBC PowerPack)
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.
Select lists from Lists table [Read more...]
SELECT * FROM Lists
Select data from a named list [Read more...]
SELECT * FROM MyList
--WHERE Id = 1234
Insert data into a named list [Read more...]
INSERT INTO MyList(Name, Surname)
VALUES ('John', 'Doe') WITH (Output=1)
Insert multiple Lookup or Person/Group IDs into a named list [Read more...]
--new version --
INSERT INTO MyList(Title, ManyPersonsLookupId, ManyPersonsLookupIdOdataType)
VALUES ('John Doe', '[11,22,33]', 'Collection(Edm.Int32)')
WITH (Output=1)
--old version --
INSERT INTO MyList(Title, ManyPersonsLookupId, "fields.ManyPersonsLookupId@odata\u002Etype")
VALUES ('John Doe', '[11,22,33]', 'Collection(Edm.Int32)')
WITH (Output=1)
--Considering "ManyPersons" is the name of the field in SharePoint List
Insert multiple Choice Values into a named list [Read more...]
--new version --
INSERT INTO MyList(Title, MultiChoiceField, MultiChoiceFieldODataType)
VALUES ('John Doe', '["Choice1","Choice5"]', 'Collection(Edm.String)')
WITH (Output=1)
--old version --
INSERT INTO MyList(Title, MultiChoiceField, "fields.MultiChoiceField@odata\u002Etype")
VALUES ('John Doe', '["Choice1","Choice5"]', 'Collection(Edm.String)')
WITH (Output=1)
--Considering "MultiChoiceField" is the name of the field in SharePoint List
Update data in a named list [Read more...]
UPDATE MyList
SET Name = 'Elizabeth', Surname = 'Johnson'
WHERE Id = '123'
Update Multi Select Lookup or Person/Group IDs field [Read more...]
UPDATE MyList
SET Title = 'Elizabeth Johnson',
--Method#1 (Pass type info in the same value)
ManyPersonsLookupId = '[11,22,33]', "fields.ManyPersonsLookupId@odata\u002Etype" = 'Collection(Edm.Int32)'
--Method#2 (Pass type info via ODataField)
--OR--
--ManyPersonsLookupId = '[11,22,33]',
--ManyPersonsLookupIdODataType" = 'Collection(Edm.Int32)
WHERE Id = '123'
Update / Insert Sharepoint List Data (Mixed Data Types - e.g. Multi Choice, Lookup, Person, DateTime, Number) [Read more...]
UPDATE "Travel Requests" --list name
SET
Title='MyTitle @ <<FUN_NOW>>'
--Method#1 Pass Value and Type in 2 fields
, CustomText = 'This is text'
, CustomTextLarge = 'This is really long text ....'
, CustomNumber = 10000.12345
, CustomDateTime ='2012-12-31T23:59:59.123Z' --End with Z to treat as UTC time (avoid local-UTC conversion)
, CustomChoice = 'BB'
--Choice Multi-Select
, CustomChoiceMulti = '["AA", "BB"]'
, CustomChoiceMultiODataType='Collection(Edm.String)' --for multi select must supply OData Type
--OR-- append like below in one field
--, CustomChoiceMulti = '["AA", "BB"], "CustomChoiceMulti@odata.type" : "Collection(Edm.String)"'
--Lookup
--field with Lookup type must be set to [<field-name>LookupId] field (suffix with LookupId)
, CustomLookupSingleLookupId = 1
--Lookup Multi-Select
, CustomLookupMultiLookupId = '[1,3]' --for multi select must supply OData Type
, CustomLookupMultiLookupIdODataType='Collection(Edm.Int32)'
--OR-- append like below in one field
--, CustomLookupMultiLookupId = '[1,3], "CustomLookupMultiLookupId@odata.type" : "Collection(Edm.String)"'
--Person
,CustomPersonLookupId = 11
--Person Multi-Select
, CustomPersonMultiLookupId = '[11, 22]'
, CustomPersonMultiLookupIdODataType='Collection(Edm.Int32)'
--OR-- append like below in one field
--, CustomPersonMultiLookupIdODataType = '[11,22], "CustomPersonMultiLookupIdODataType@odata.type" : "Collection(Edm.Int32)"'
Where Id=1 --List Item Id
--- Insert Example ----
INSERT INTO "Travel Requests" --list name
(
Title
, CustomText
, CustomTextLarge
, CustomNumber
, CustomDateTime
, CustomChoice
, CustomChoiceMulti
, CustomChoiceMultiODataType
, CustomLookupSingleLookupId
--Lookup Multi-Select
, CustomLookupMultiLookupId
, CustomLookupMultiLookupIdODataType
--Person
,CustomPersonLookupId
, CustomPersonMultiLookupId
, CustomPersonMultiLookupIdODataType
)
VALUES(
'MyTitle @ <<FUN_NOW>>'
, 'This is text'
, 'This is really long text .. '
, 10000.12345
, '2012-12-31T23:59:59.123Z' --End with Z to treat as UTC time (avoid local-UTC conversion)
, 'BB'
--Choice Multi-Select
, '["AA", "BB"]'
, 'Collection(Edm.String)' --for multi select must supply OData Type
--Lookup
, 1
--Lookup Multi-Select
, '[1,3]' --for multi select must supply OData Type
, 'Collection(Edm.Int32)'
--Person
,11
--Person Multi-Select
, '[11, 22]'
, 'Collection(Edm.Int32)'
)
Delete item from a named list [Read more...]
DELETE FROM MyList WHERE Id=888
--OR--
DELETE FROM MyList WITH (ListItemId='123')
--ListItemId can be retrieved by selecting from named list table, e.g. 'MyList'.
Main site [Read more...]
Gets main SharePoint site details
SELECT * FROM get_main_site
List sites [Read more...]
Lists all available SharePoint sites
SELECT * FROM Sites
List drives [Read more...]
Lists all drives
SELECT * FROM Drives
Get drive [Read more...]
SELECT * FROM get_drive
WITH (DriveId='b!GtLQTMU726LE0eY5F2BBNi14-XXXXXXXXXXX-GuQ4DORpHy-XXXXXXXXXXXXXX')
--You can get DriveId by selecting from 'Drives' table.
List folders from SharePoint Document Library [Read more...]
SELECT * FROM list_folders
WITH (DriveId='b!GtLN726LE0eY5F2BBNi14wMKmwdpCDFMn1d71ra11GuQ4DORpHy-XXXXXXXXXXXXX')
--You can get DriveId by selecting from 'Drives' table.
List files from SharePoint Document Library [Read more...]
SELECT * FROM list_files
WITH (DriveId='b!GtLN726LE0eY5F2BBNi14wMKmwdpCDFMn1d71ra11GuQ4DORpHy-XXXXXXXXXXXXX')
--You can get DriveId by selecting from 'Drives' table.
List Excel files from SharePoint Document Library [Read more...]
SELECT * FROM list_excel_files
WITH (DriveId='b!GtLN726LE0eY5F2BBNi14wMKmwdpCDFMn1d71ra11GuQ4DORpHy-XXXXXXXXXXXX')
--You can get DriveId by selecting from 'Drives' table.
Get list fields [Read more...]
SELECT * FROM get_list_fields
WITH (ListId='2e1d58e4-eced-4d1c-9279-XXXXXXXXXXXXX')
--You can get ListId by selecting from 'list_lists' endpoint.
Get list items (SharePoint Document Library) [Read more...]
SELECT * FROM get_list_items
WITH (ListId='14bdfd1d-1090-4cfe-adc1-XXXXXXXXXXXXXX')
--You can get ListId by selecting from 'list_lists' endpoint.
Get list items - dynamic metadata (SharePoint Document Library) [Read more...]
Gets items of a specific list using dynamic metadata approach. Use this if other endpoint is showing null values for complex datatypes (e.g. Lookup, Location, Person)
SELECT * FROM get_list_items_dynamic
WITH (ListId='14bdfd1d-1090-4cfe-adc1-XXXXXXXXXXXXXX')
--You can get ListId by selecting from 'list_lists' endpoint.
Create list item (SharePoint Document Library) [Read more...]
INSERT INTO create_list_item(Title, OrderId)
VALUES ('My super title', 12345)
WITH (ListId='14bdfd1d-1090-4cfe-adc1-XXXXXXXXXXXXXX'
,Output=1)
--You can get ListId by selecting from 'list_lists' endpoint.
Update list item (SharePoint Document Library) [Read more...]
UPDATE update_list_item
SET Title = 'My super title', OrderId = 12345
WITH (ListId='14bdfd1d-1090-4cfe-adc1-XXXXXXXXXXXXX'
,ListItemId='775'
,Output=1)
--You can get ListId by selecting from 'list_lists' endpoint.
--ListItemId can be retrieved by selecting from 'get_list_items' endpoint.
Delete list item (SharePoint Document Library) [Read more...]
DELETE FROM delete_list_item
WITH (ListId='14bdfd1d-1090-4cfe-adc1-XXXXXXXXXXXXXX'
,ListItemId='775')
--You can get ListId by selecting from 'list_lists' endpoint.
--ListItemId can be retrieved by selecting from 'get_list_items' endpoint.
List Excel file worksheets (SharePoint Document Library) [Read more...]
SELECT * FROM list_excel_worksheets
WITH (DriveId='b!GtLN726LE0eY5F2BBNi14wMKmwdpCDFMn1d71ra11GuQ4DORpHy-XXXXXXXXXXXXXX'
,FileId='01SUOJPKECYDDVFZWXXXXXXXXXXXXXXXXX')
--DriveId can be retrieved by selecting from 'Drives' table.
--FileId can be retrieved by selecting from 'list_files' endpoint.
Read Excel Worksheet (SharePoint Document Library) - Auto Detect Range [Read more...]
Reads an Excel file without supplying Cell Address Range (It auto detects based on first and last cell)
SELECT * FROM get_excel_worksheet_autodetect
WITH (DriveId='b!GtLN726LE0eY5F2BBNi14wMKmwdpCDFMn1d71ra11GuQ4DORpHy-XXXXXXXXXXX'
,FileId='01SUOJPKECYDDVFXXXXXXXXXXXXXXXXXX'
,SheetId='Sheet1' --Id or Name
,AutoDetectByValue='true'
,ArrayTransEnableCustomColumns='True' --set this to False if No header in first row
)
--DriveId can be retrieved by selecting from 'Drives' table.
--FileId can be retrieved by selecting from 'list_files' endpoint.
--SheetId can be retrieved by downloading Excel file and discovering what sheets exist or by selecting from 'list_excel_worksheets' endpoint.
Read Excel Worksheet (SharePoint Document Library) for a specified Cell Address Range [Read more...]
Reads an Excel file from a specified Cell Range. To automatically read without cell range use other endpoint get_excel_worksheet_autodetect
SELECT * FROM get_excel_worksheet
WITH (DriveId='b!GtLN726LE0eY5F2BBNi14wMKmwdpCDFMn1d71ra11GuQ4DORpHy-XXXXXXXXXXX'
,FileId='01SUOJPKECYDDVFXXXXXXXXXXXXXXXXXX'
,SheetId='Sheet1' --Id or Name
,Range='A1:K10000'
,ArrayTransEnableCustomColumns='True' --set this to False if No header in first row
)
--DriveId can be retrieved by selecting from 'Drives' table.
--FileId can be retrieved by selecting from 'list_files' endpoint.
--SheetId can be retrieved by downloading Excel file and discovering what sheets exist or by selecting from 'list_excel_worksheets' endpoint.
--Range should be set to Excel-type of range where data is located.
Upload a file to a SharePoint Document Library [Read more...]
SELECT * FROM upload_file
WITH (DriveId='b!GtLN726LE0eY5F2BBNi14wMKmwdpCDFMn1d71ra11GuQ4DORpHy-XXXXXXXXXXX'
,DiskFilePath='C:\My files\Employees\List.xls'
,SharePointFilePath='List.xlsx' --Upload on Root (Create -or- Overwrite if ConflictBehavior = 'replace')
--,SharePointFilePath='myfolder/List.xlsx' --Upload under some folder
--,SharePointFilePath='01SUOJPKGJXIXXGXACFVDK3QH5JYARFOMB' --Overwrite Exising File Id
--,ConflictBehavior = 'replace' -- fail, rename, replace (If File Exists Default=fail)
--,UseSourceFileTimeStamp = 'true' --By default uploaded file set Current Date/Time for Creation/Modified date
)
--DriveId can be retrieved by selecting from 'Drives' table.
Upload a file to SharePoint Document Library (Overwrite file if exists) [Read more...]
Uploads a file to a SharePoint Document Library and if file already exists then overwrite it rather than throwing error (Default is throw error)
SELECT * FROM upload_file
WITH (DriveId='b!GtLN726LE0eY5F2BBNi14'
,DiskFilePath='C:\My files\Employees\List.xls'
,SharePointFilePath='List.xlsx' --Upload on Root (Create -or- Overwrite if ConflictBehavior = 'replace')
--,SharePointFilePath='myfolder/List.xlsx' --Upload under some folder
--,SharePointFilePath='01SUOJPKGJXIXXGXACFVDK3QH5JYARFOMB' --Overwrite Exising File Id
,ConflictBehavior = 'replace' -- fail, rename, replace (If File Exists Default=fail)
--,UseSourceFileTimeStamp = 'true' --By default uploaded file set Current Date/Time for Creation/Modified date
)
--DriveId can be retrieved by selecting from 'list_drives' endpoint.
Download a file to a local disk from a SharePoint document library [Read more...]
SELECT * FROM download_file_to_disk
WITH(
DriveId='b!GtLN726LE0eY5F2BBNi14wMKmwdpCDFMxxxxxxxxxxxxx'
, FileId='01SUOJPKDXTQL2XI2EIFDYZxxxxxxxxxxxxx'
, TargetFilePath='C:\temp\List.xlsx'
--, FileOverwriteMode='FailIfExists' //change default overwrite mode from AlwaysOverwrite to FailIfExists
)
--DriveId can be retrieved by selecting from 'Drives' table.
--FileId can be retrieved by selecting from 'list_files' endpoint.
Read a SharePoint file content as BASE64 (Binary to string) [Read more...]
Read file content as base64 string (Binary to Base64) and also save Base64 to disk to recreate file.
SELECT Data as BYTES_AS_BASE64_STRING, BASE64_TO_FILE('C:\My files\Employees\List.xls', Data) FILE_SAVED_TO_DISK_FROM_BASE64
FROM download_file
WITH (DriveId='b!GtLN726LE0eY5F2BBNi14wMKmwdpCDFMn1d71ra11GuQ4DORpHy-XXXXXXXXXXXXX'
,FileId='01SUOJPKHXMPKD2UXXXXXXXXXXXXXXXXXX')
--DriveId can be retrieved by selecting from 'Drives' table.
--FileId can be retrieved by selecting from 'list_files' endpoint.
Get full image path from Image type field [Read more...]
By default Image field in your List will show JSON document which contains many pieces of your Image field. To get full path of your Image file you can use JSON_VALUE function and extract multiple fields and concat together to get full path like below.
SELECT *,(JSON_VALUE(MyImageField,'$.serverUrl') || JSON_VALUE(MyImageField,'$.serverRelativeUrl')) as DevicePhotoUrl,
FROM "My SharePoint List Name"
List files in a folder path (Recursive) [Read more...]
Use list_files endpoint to list files recursively (list from child folder). However there are some limitations to list recursively, such as some new files may not appear right away or files not indexed wont show up.
SELECT * FROM list_files
WITH(
Filter='$.value[*]' --list both files and folders
--Filter='$.value[?(@.file.mimeType != null)]' --list only files
--Filter='$.value[?(@.folder.childCount != null)]' --list only folders
,DriveId='b!GtLN726LE0eY5F2BBNi14wMKmwdpCDFMn1d71ra11GuQ4DORpHy-Sa5UzSpkaY9E'
--,SearchPath='/root' --default
--,SearchPath='/root:/myfolder:' --folder path
,SearchPath='/root:/myfolder/subfolder:' --folder path nested
,OrderBy='lastModifiedDateTime desc'
)
--You can get DriveId by selecting from 'Drives' table.
List files in a folder Id (Non-Recursive) [Read more...]
This examplel shles under a specific FolderId (Available in Non-recursive mode only).
SELECT * FROM list_files
WITH(
Filter='$.value[*]' --list both files and folders
--Filter='$.value[?(@.file.mimeType != null)]' --list only files
--Filter='$.value[?(@.folder.childCount != null)]' --list only folders
,DriveId='b!GtLN726LE0eY5F2BBNi14wMKmwdpCDFMn1d71ra11GuQ4DORpHy-Sa5UzSpkaY9E'
,SearchType='children' --must use this type if you like to list items by FolderId
,SearchPath='/items/01SUOJPKBVT5ZC2KVSXJAYSTTMA4I3GMHX'
)
--You can get DriveId by selecting from 'Drives' table.
Create / Update a CSV File from External Data Source (e.g. MSSQL / ODBC) [Read more...]
This example shows how to create / update a CSV file directly inside SharePoint Document Library using streaming approach. This example reads records from Microsoft SQL Server database and writes data to CSV file on SharePoint Document Library. If file does not exists then it creates a new one.
INSERT INTO FileReaderWriterCsv
SOURCE( 'MSSQL'--OR 'ODBC'
, 'Data Source=localhost;Initial Catalog=Northwind;Integrated Security=true'
, 'select OrderId,CustomerId,OrderDate FROM Northwind.dbo.Orders'
)
WITH(
DriveId='b!0zqXLXXJh0uUMzl-JXAd9Ztngc-5utVDqRyD2lKpD2535-11HLQTR5z4hOzmA7Q0'
, FileId='root:/test_out.csv:'
--, FileId='root:/subfolder/test_out.csv:'
--, FileId='01N3NxxxxxxxWZYSDJ' --exising File ID
--, ColumnDelimiter=',' --{LF}, {TAB}, | , \x0009 ...
--, RowDelimiter='{NEWLINE}' --{LF}, {TAB}, | , \x0009 ...
--, HasColumnHeaderRow=0 --set for header less file
--, WriterDateTimeFormat='yyyy-MM-ddTHH:mm:ss.fff'
--See Query Builder for more options
)
Create / Update a JSON File in SharePoint Document Library from External Data Source (e.g. MSSQL / ODBC) [Read more...]
This example shows how to create / update a JSON file directly inside SharePoint Document Library using streaming approach. This example reads records from Microsoft SQL Server database and writes data to JSON file on SharePoint Document Library. If file does not exists then it creates a new one. It uses LayoutMap to generate JSON with custom layout.
INSERT INTO FileReaderWriterJson
SOURCE( 'MSSQL'--OR 'ODBC'
, 'Data Source=localhost;Initial Catalog=Northwind;Integrated Security=true'
, 'select OrderId,CustomerId,OrderDate FROM Northwind.dbo.Orders'
)
WITH(
DriveId='b!0zqXLXXJh0uUMzl-JXAd9Ztngc-5utVDqRyD2lKpD2535-11HLQTR5z4hOzmA7Q0'
, FileId='root:/test_out.json:'
--, FileId='root:/subfolder/test_out.json:'
--, FileId='01N3NxxxxxxxWZYSDJ' --exising File ID
, JsonOutputFormat='Multicontent' --Default , Array2D, ArrayLines ...
--, DoNotOutputNullProperty='True'
--, Encoding='UTF8' --UTF8WithoutBOM
--, WriterDateTimeFormat='yyyy-MM-ddTHH:mm:ss.fff'
--Example#1: Output all columns
, LayoutMap='<?xml version="1.0" ?>
<settings>
<dataset id="root" main="True" readfrominput="True" />
<map src="*" />
</settings>'
--Example#2: Nested JSON (Records under an array)
/*
, LayoutMap='<?xml version="1.0" ?>
<settings singledataset="True">
<dataset id="root" main="True" readfrominput="True" />
<map name="MyArray" dataset="root" maptype="DocArray">
<map src="OrderID" name="OrderID" />
<map src="OrderDate" name="OrderDate" />
</map>
</settings>'
*/
--Example#3: Nested JSON (Records under a sub document section)
/*
, LayoutMap='<?xml version="1.0" ?>
<settings>
<dataset id="dsRoot" main="True" readfrominput="True" />
<map name="NestedSection">
<map src="OrderID" name="OrderID_MyLabel" />
<map src="OrderDate" name="OrderDate_MyLabel" />
</map>
</settings>'
*/
)
Read CSV File from SharePoint Document Library (Parse Rows and Columns without downloading) [Read more...]
This example shows how to read a CSV file from SharePoint Document Library without downloading on the Disk (Streaming approach).
SELECT * from get_csv_file
WITH(
DriveId='b!0zqXLXXJh0uUMzl-JXAd9Ztngc-5utVDqRyD2lKpD2535-11HLQTR5z4hOzmA7Q0'
, FileId='root:/MyFolder/dump.csv:'
--, ColumnDelimiter=',' --{LF}, {TAB}, | , \x0009 ... default is comma (",")
--, HasColumnHeaderRow=0 --set for header less file
--, FileId='root:/MyFolder/test_out.csv.gz:'
--, FileCompressionType='GZip' --None, GZip, Zip
)
Read Zip/Gzip Compressed CSV File from SharePoint Document Library (Parse Rows and Columns without downloading) [Read more...]
This example shows how to read a compressed CSV file (Zip or Gzip) from SharePoint Document Library without downloading on the Disk (Streaming approach).
SELECT * from get_csv_file
WITH(
DriveId='b!0zqXLXXJh0uUMzl-JXAd9Ztngc-5utVDqRyD2lKpD2535-11HLQTR5z4hOzmA7Q0'
, FileId='root:/MyFolder/dump.csv.zip:'
--, ColumnDelimiter=',' --{LF}, {TAB}, | , \x0009 ... default is comma (",")
--, HasColumnHeaderRow=0 --set for header less file
--, FileId='root:/MyFolder/dump.csv.gz:'
, FileCompressionType='Zip' --None, GZip, Zip
)
Read JSON File from SharePoint Document Library (Parse Rows and Columns without downloading) [Read more...]
This example shows how to read a JSON file from SharePoint Document Library without downloading on Disk (Streaming approach).
SELECT * from get_json_file
WITH(
DriveId='b!0zqXLXXJh0uUMzl-JXAd9Ztngc-5utVDqRyD2lKpD2535-11HLQTR5z4hOzmA7Q0'
, FileId='root:/MyFolder/dump.json:'
, Filter='$.store.books[*]' --or just blank (see help file for more filter examples)
--to read compressed file use below way
--, FileId='root:/MyFolder/dump.json.gz:'
--, FileCompressionType='GZip' --None, GZip, Zip
)
Read Zip/Gzip Compressed JSON File from SharePoint Document Library (Parse Rows and Columns without downloading) [Read more...]
This example shows how to read a compressed JSON file (Zip or Gzip) from SharePoint Document Library without downloading on the Disk (Streaming approach).
SELECT * from get_json_file
WITH(
DriveId='b!0zqXLXXJh0uUMzl-JXAd9Ztngc-5utVDqRyD2lKpD2535-11HLQTR5z4hOzmA7Q0'
, FileId='root:/MyFolder/dump.json.zip:'
, Filter='$.store.books[*]' --or just blank (see help file for more filter examples)
, FileCompressionType='Zip' --None, GZip, Zip
)
Generic API Call - Update MultiChoice / Multi Select Lookup field in SharePoint List [Read more...]
This example shows how to make generic API call to update fields which allow multiple value selection in either Lookup or MultiChoice datatype. This example shows 2 types of fields. One is Multi Select e.g. MyMultiSelectLookupCol / MyMultiChoiceCol and another is Single select MySingleSelectCol (i.e. Dropdown). You must supply odata.type for Field. If its MultiChoice you can supply string ID/Value but set odata.type as Edm.String rather than Edm.Int32
SELECT * from generic_request
WITH(
Url='https://graph.microsoft.com/v1.0/sites/root/lists/1d3126af-14ca-46c7-a82a-4865873756c6/items/1'
, RequestMethod='PATCH'
, Filter='$.fields'
, Headers='Content-Type: application/json || x-header2: abcd'
, Body='{
"fields": {
"MyMultiSelectLookupColLookupId@odata.type": "Collection(Edm.Int32)"
,"MyMultiSelectLookupColLookupId": [ 1 , 2 ]
,"MyMultiChoiceColumn@odata.type": "Collection(Edm.String)"
,"MyMultiChoiceColumn": [ "AAA" , "BBB" ]
,"MySingleChoiceColumnLookupId":1
}
}'
)
Move a File or Folder in SharePoint Document Library [Read more...]
This example shows how to move a file or folder to a different location in SharePoint Document Library. It also shows how to use Placeholder Functions to name file daynamically. For example to add timestamp it uses <<yyyy-MM-dd-HH-mm-ss-fff,FUN_NOW>>
SELECT * FROM move_rename_item
WITH(
--Source Site (Leave blank for default)
-- SiteId='abc.sharepoint.com,5304daff-xxxxxxxxxx'
--Source Drive
, DriveId='b!0zqxxxxxxxxxxxxxxxxxxxxxxxx'
--Item Id (File or Folder) you like to move or rename
, ItemId='01R65QTTRARZ42C4BN6FF2WOH3AONX4GUW'
--Target Site Id (Optional): Only needed if moving file to a different Site
--, TargetSiteId='xyz.sharepoint.com,5304daff-xxxxxxxxxx'
--Target Drive Id (Optional): Only needed if moving file to a different Drive
--, TargetDriveId='b!0zqXLXXJh0uxxxxxxxxxxxxxxxxxxxxx'
--Target Folder Id
, TargetFolderId='01R65QTTTBPH6V2AP36VD33CYYDXJSNHLN'
--OR (for moving to root)
--, TargetFolderId='root'
--Target Item Name after Move (Optional): If you do not wish to change name after Move then do not supply below
--, TargetItemName='new_file_name_<<yyyy-MM-dd-HH-mm-ss-fff,FUN_NOW>>.pdf'
--Uncomment Below if you get error. Usually needed for large file or cross site operations
--, Prefer='respond-async'
)
Rename a File or Folder in SharePoint Document Library [Read more...]
This example shows how to rename a file or folder and you can also move to a different location in SharePoint Document Library. It also shows how to use Placeholder Functions to name file daynamically. For example to add timestamp it uses <<yyyy-MM-dd-HH-mm-ss-fff,FUN_NOW>>
SELECT * FROM move_rename_item
WITH(
--Source Site (Leave blank for default)
-- SiteId='abc.sharepoint.com,5304daff-xxxxxxxxxx'
--Source Drive
, DriveId='b!0zqxxxxxxxxxxxxxxxxxxxxxxxx'
--Source Item you like to rename (File or Folder)
, ItemId='01R65QTTRARZ42C4BN6FF2WOH3AONX4GUW'
--Target Site Id (Optional): Only needed if moving file to a different Site
--, TargetSiteId='xyz.sharepoint.com,5304daff-xxxxxxxxxx'
--Target Drive Id (Optional): Only needed if moving file to a different Drive
--, TargetDriveId='b!0zqXLXXJh0uxxxxxxxxxxxxxxxxxxxxx'
--Target Folder (Optional): If you are doing just rename and moving to different location then keep it keep blank
--, TargetFolderId='01R65QTTTBPH6V2AP36VD33CYYDXJSNHLN'
--, TargetFolderId='root'
--Target Item Name (Required for rename)
, TargetItemName='new_file_name_<<yyyy-MM-dd-HH-mm-ss-fff,FUN_NOW>>.pdf'
--Uncomment Below if you get error. Usually needed for large file or cross site operations
--, Prefer='respond-async'
)
Copy a File or Folder in SharePoint Document Library [Read more...]
This example shows how to copy a file or folder to a different location in SharePoint Document Library (In same Drive or different SharePoint Document Library). It also shows how to use Placeholder Functions to name file daynamically. For example to add timestamp it uses <<yyyy-MM-dd-HH-mm-ss-fff,FUN_NOW>>
SELECT * FROM copy_item
WITH(
--Source Site (Leave blank for default)
-- SiteId='xxxx'
--Source Drive
, DriveId='b!0zqxxxxxxxxxxxxxxxxxxxxxxxx'
--Source Item you like to copy
, ItemId='01R65QTTRARZ42C4BN6FF2WOH3AONX4GUW'
--Target Site (Optional)
-- SiteId='abc.sharepoint.com,5304daff-xxxxxxxxxx'
--Target Drive Id (Optional): Only needed if copying file to a different Drive (e.g. another User's drive)
--, TargetDriveId='b!0zqXLXXJh0uxxxxxxxxxxxxxxxxxxxxx'
--Target Folder where item will be copied
, TargetFolderId='01R65QTTTBPH6V2AP36VD33CYYDXJSNHLN'
--OR--
--, TargetFolderId='root'
--Target item name (Optional) - Only needed if new name needed after copy
, TargetItemName='new_file_or_folder_name_<<yyyy-MM-dd-HH-mm-ss-fff,FUN_NOW>>.pdf'
--,ConflictBehavior='replace' --fail, rename (Ignored if TargetItemName is not supplied)
--Uncomment Below if you get error. Usually needed for large file or cross site operations
--, Prefer='respond-async'
)