OneDrive
Connect to OneDrive to manage your files. You can perform various actions such as upload, update, get, and delete on files in OneDrive.
This connector is available in the following products and regions:
Service | Class | Regions |
---|---|---|
Logic Apps | Standard | All Logic Apps regions except the following: - US Department of Defense (DoD) |
Power Automate | Standard | All Power Automate regions except the following: - China Cloud operated by 21Vianet |
Power Apps | Standard | All Power Apps regions except the following: - China Cloud operated by 21Vianet |
Contact | |
---|---|
Name | Microsoft |
URL | Microsoft LogicApps Support Microsoft Power Automate Support Microsoft Power Apps Support |
Connector Metadata | |
---|---|
Publisher | Microsoft |
Website | https://products.office.com/onedrive/online-cloud-storage |
The following are some of the known limitations and file size constraints in place for the protection of the connector’s service. Kindly note that attempting to perform operations beyond the limits will result in rejection, errors, or timeouts.
If you see an error while converting the file to PDF in the flow (e.g. “Bad gateway” or “The resource could not be found”) using OneDrive connector, the recommendation to workaround this issue would be to increase the delay between the file creation and converting to PDF.
For troubleshooting the issue with HTML to PDF conversion, please learn more here.
The maximum archive size for Extract archive to folder action is 50 MB and 100 files inside.
The When a file is created or When a file is modified triggers will skip every file bigger than 50 MB.
The Copy File action for larger files may fail with time out error (due to needing to take longer to copy larger files). The size at which this occurs varies depending on the service load.
The Upload file from URL action will always report success after 20 seconds regardless of the actual result. Depending on file size or source download rate, the upload process may take a longer time. To be sure about actual results, you should always create logic in the Flow to check for the existence of the file and/or a timeout before operating on the uploaded file data.
Accessing shared files across tenant hostname boundaries is not supported. Example: a user in contoso-my.sharepoint.com cannot access a file in microsoft-my.sharepoint.com
Multi-geo scenarios are not supported. Example: a user in contosoeu-my.sharepoint.com cannot access a file in contosoaus-my.sharepoint.com
Some errors, like "Access Denied" usually indicate that the file is locked (e.g. by Excel services). Also, the user, file, folder, or tenant may have a policy preventing access. Please see the SharePoint/OneDrive for Business Policies page for details here.
Please note that certain policies can prevent users from using parts or all of the OneDrive connector. The most common policies involve:
- (Sharing) Prevent file download The OneDrive connector often relies on being able to download the contents of a file. The Prevent File Download policy can prevent the connector from downloading file contents, as it is an uncontrolled expatriation point for data.
- Control access from unmanaged devices Similarly, to prevent file download, OneDrive Connector cannot be verified as a managed device since it provides an uncontrolled expatriation point for data.
- Control access to SharePoint and OneDrive data based on network location Same as above, OneDrive connector resides on trusted Microsoft networks but can expatriate data.
The When a file is modified and When a file is modified (properties only) triggers make a best effort to filter uninteresting modification events (such as instances where file metadata or sharing permissions are modified). However, as OneDrive itself does not provide any explicit facilities to differentiate different kinds of modifications, this process is purely heuristic-based and can occasionally fire the trigger when no noticeable change has occurred.
Nota
The connector couldn't determine whenever a file change was initiated by a user or not. The OneDrive services and apps can automatically make the changes in files without user interaction (for example, the Office apps). (especially when using Office software). Therefore, you should make sure that your Flows do not rely solely on OneDrive connector's file changed detection as the trigger can fire one or more times than expected. To workaround this behavior, your processes should have checks or human approval, or be reimplemented using files as the basic unit (rather than entries within a file), as On New File does not have these constraints.
- On new file and on modified file triggers (all variants) currently may have issues when there are more than approximately 30 pending changes between two trigger polls.
- Cross-drive functionality is not supported in the OneDrive connector. The connector can only operate on the account used to make the connection to the connector and on data owned by that account. That limitation includes files and folders added with Add to Onedrive / Add shortcut.
- If you are getting an error while trying to create a connection, please make sure that you use the Microsoft personal account instead of the Microsoft business account.
- The OneDrive connector will only display up to 200 items per folder in the file picker. Users may have trouble finding items if they have more than 200 items in a folder.
- The Convert file (Preview) action does not support converting digitally signed, password-protected, or IRM restricted documents from a Microsoft Word document to PDF, due to security reasons.
- The Extract Archive to Folder action does not support multi-byte characters in the file name.
For more information about the connector, see the in-depth section.
Name | Calls | Renewal Period |
---|---|---|
API calls per connection | 100 | 60 seconds |
Add file tag |
This operation adds a tag to a file. |
Convert file (Preview) |
This operation converts a file to another format. The list of supported conversions can be found at https://aka.ms/onedriveconversions |
Convert file using path (Preview) |
This operation converts a file to another format using the path. The list of supported conversions can be found at https://aka.ms/onedriveconversions |
Copy file |
This operation copies a file within OneDrive. |
Copy file using path |
This operation copies a file within OneDrive by path. |
Create file |
This operation creates a file. |
Create share link |
This operation creates a share link for a file. |
Create share link [DEPRECATED] |
This action has been deprecated. Please use Create share link instead.
|
Create share link by path |
This operation creates a share link for a file using the path. |
Create share link by path [DEPRECATED] |
This action has been deprecated. Please use Create share link by path instead.
|
Delete file |
This operation deletes a file. |
Extract archive to folder |
This operation extracts an archive file into a folder (example: .zip). Maximum archive size is 50 MB and 100 files inside. |
Find files in folder |
This operation finds files within a folder using search or name pattern match. |
Find files in folder by path |
This operation finds files within a folder by path using search or name pattern match. |
Get file content |
This operation gets the content of a file. |
Get file content using path |
This operation gets the content of a file using the path. |
Get file metadata |
This operation gets the metadata for a file. |
Get file metadata using path |
This operation gets the metadata of a file using the path. |
Get file tags |
This operation gets the tags of a file. |
Get file thumbnail |
This operation gets the thumbnail of a file. The thumbnail will only be valid for 6 hours. |
List files in folder |
This operation gets the list of files and subfolders in a folder. |
List files in folder [DEPRECATED] |
This action has been deprecated. Please use List files in folder instead.
|
List files in root folder |
This operation gets the list of files and subfolders in the root folder. |
Move or rename a file |
This operation moves or renames a file. |
Move or rename a file using path |
This operation moves or renames a file using the path. |
Remove file tag |
This operation removes a tag from a file. |
Update file |
This operation updates a file. |
Upload file from URL |
This operation uploads a file from a URL to OneDrive. |
This operation adds a tag to a file.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
File
|
id | True | string |
The unique identifier of the file. |
Tag
|
tag | True | string |
The name of the tag. |
Returns
Tags
- Body
- Tags
This operation converts a file to another format. The list of supported conversions can be found at https://aka.ms/onedriveconversions
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
File
|
id | True | string |
The unique identifier of the file. |
Target type
|
type | string |
The target file type |
Returns
The content of the file.
- File content
- binary
This operation converts a file to another format using the path. The list of supported conversions can be found at https://aka.ms/onedriveconversions
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
File Path
|
path | True | string |
The unique path of the file. |
Target type
|
type | string |
The target file type |
Returns
The content of the file.
- File content
- binary
This operation copies a file within OneDrive.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
File
|
id | True | string |
The unique identifier of the file. |
Destination File Path
|
destination | True | string |
The destination file path, including target filename. |
Overwrite
|
overwrite | boolean |
Overwrites the destination file if set to 'true'. |
Returns
Blob metadata
- Body
- BlobMetadata
This operation copies a file within OneDrive by path.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
File Path
|
source | True | string |
The unique path of the file. |
Destination File Path
|
destination | True | string |
The destination file path, including target filename. |
Overwrite
|
overwrite | boolean |
Overwrites the destination file if set to 'true'. |
Returns
Blob metadata
- Body
- BlobMetadata
This operation creates a file.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
Folder Path
|
folderPath | True | string |
The unique path of the folder. |
File Name
|
name | True | string |
The name of the file. Certain characters are disallowed by OneDrive and will be replaced by underscores. |
File Content
|
body | True | binary |
The content of the file. |
Returns
Blob metadata
- Body
- BlobMetadata
This operation creates a share link for a file.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
File
|
id | True | string |
The unique identifier of the file. |
Link type
|
type | True | string |
The type of link |
Returns
- Body
- SharingLink
This action has been deprecated. Please use Create share link instead.
This operation creates a share link for a file.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
File
|
id | True | string |
The unique identifier of the file. |
Link type
|
type | True | string |
The type of link |
Returns
- Body
- SharingLink
This operation creates a share link for a file using the path.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
File Path
|
path | True | string |
The unique path of the file. |
Link type
|
type | True | string |
The type of link |
Returns
- Body
- SharingLink
This action has been deprecated. Please use Create share link by path instead.
This operation creates a share link for a file using the path.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
File Path
|
path | True | string |
The unique path of the file. |
Link type
|
type | True | string |
The type of link |
Returns
- Body
- SharingLink
This operation deletes a file.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
File
|
id | True | string |
The unique identifier of the file. |
This operation extracts an archive file into a folder (example: .zip). Maximum archive size is 50 MB and 100 files inside.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
Source Archive File Path
|
source | True | string |
The path to the archive file. |
Destination Folder Path
|
destination | True | string |
The path to extract the archive contents. |
Overwrite
|
overwrite | boolean |
Overwrites the destination files if set to 'true'. |
Returns
- response
- array of BlobMetadata
This operation finds files within a folder using search or name pattern match.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
Search Query
|
query | True | string |
The search query to use |
Folder
|
id | True | string |
The unique identifier of the folder. |
File Search Mode
|
findMode | True | string |
The search method to use. "Search" mode searches your OneDrive using the search query (similar a normal search engine). When "Regular Expression Pattern Match" mode is selected, the search query will be treated as a regex pattern, and it will return files with names that match the query |
Number of files to return
|
maxFileCount | integer |
Maximum number of files to return (1-100) |
Returns
- response
- array of BlobMetadata
This operation finds files within a folder by path using search or name pattern match.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
Search Query
|
query | True | string |
The search query to use |
Folder Path
|
path | True | string |
The unique path of the folder. |
File Search Mode
|
findMode | True | string |
The search method to use. "Search" mode searches your OneDrive using the search query (similar a normal search engine). When "Regular Expression Pattern Match" mode is selected, the search query will be treated as a regex pattern, and it will return files with names that match the query |
Number of files to return
|
maxFileCount | integer |
Maximum number of files to return (1-100) |
Returns
- response
- array of BlobMetadata
This operation gets the content of a file.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
File
|
id | True | string |
The unique identifier of the file. |
Infer Content Type
|
inferContentType | boolean |
A boolean value (true, false) to infer content-type based on extension. |
Returns
The content of the file.
- File content
- binary
This operation gets the content of a file using the path.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
File Path
|
path | True | string |
The unique path of the file. |
Infer Content Type
|
inferContentType | boolean |
A boolean value (true, false) to infer content-type based on extension. |
Returns
The content of the file.
- File content
- binary
This operation gets the metadata for a file.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
File
|
id | True | string |
The unique identifier of the file. |
Returns
Blob metadata
- Body
- BlobMetadata
This operation gets the metadata of a file using the path.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
File Path
|
path | True | string |
The unique path of the file. |
Returns
Blob metadata
- Body
- BlobMetadata
This operation gets the tags of a file.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
File
|
id | True | string |
The unique identifier of the file. |
Returns
Tags
- Body
- Tags
This operation gets the thumbnail of a file. The thumbnail will only be valid for 6 hours.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
File
|
id | True | string |
The unique identifier of the file. |
Thumbnail Size
|
size | True | string |
The size of the thumbnail to retrieve. |
Returns
Thumbnail response data
- Body
- Thumbnail
This operation gets the list of files and subfolders in a folder.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
Folder
|
id | True | string |
The unique identifier of the folder. |
Returns
Represents a page of blob metadata.
- Body
- BlobMetadataPage
This action has been deprecated. Please use List files in folder instead.
This operation gets the list of files and subfolders in a folder.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
Folder
|
id | True | string |
The unique identifier of the folder. |
Include subfolders
|
includeSubfolders | boolean |
Include items in subfolders |
Returns
- response
- array of BlobMetadata
This operation gets the list of files and subfolders in the root folder.
Returns
- response
- array of BlobMetadata
This operation moves or renames a file.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
File
|
id | True | string |
The unique identifier of the file. |
Destination File Path
|
destination | True | string |
The destination file path, including target filename. |
Overwrite
|
overwrite | boolean |
Overwrites the destination file if set to 'true'. |
Returns
Blob metadata
- Body
- BlobMetadata
This operation moves or renames a file using the path.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
File Path
|
source | True | string |
The unique path of the file. |
Destination File Path
|
destination | True | string |
The destination file path, including target filename. |
Overwrite
|
overwrite | boolean |
Overwrites the destination file if set to 'true'. |
Returns
Blob metadata
- Body
- BlobMetadata
This operation removes a tag from a file.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
File
|
id | True | string |
The unique identifier of the file. |
Tag
|
tag | True | string |
The name of the tag. |
This operation updates a file.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
File
|
id | True | string |
The unique identifier of the file. |
File Content
|
body | True | binary |
The content of the file. |
Returns
Blob metadata
- Body
- BlobMetadata
This operation uploads a file from a URL to OneDrive.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
Source URL
|
source | True | string |
The url to the source file. |
Destination File Path
|
destination | True | string |
The destination file path, including target filename. |
Overwrite
|
overwrite | boolean |
Overwrites the destination file if set to 'true'. |
Returns
Blob metadata
- Body
- BlobMetadata
When a file is created |
This operation triggers a flow when a new file is created in a folder. Files larger than 50 MB will be skipped and not returned by this trigger. Files moved within OneDrive are not considered new files. |
When a file is created (properties only) |
This operation triggers a flow when a new file is created in a folder. Files moved within OneDrive are not considered new files. |
When a file is created (properties only) [DEPRECATED] |
This action has been deprecated. Please use When a file is created (properties only) instead.
|
When a file is created [DEPRECATED] |
This action has been deprecated. Please use When a file is created instead.
|
When a file is deleted (properties only) |
This operation triggers a flow when a file is deleted from a folder. |
When a file is modified |
This operation triggers a flow when a file is modified in a folder. Files larger than 50 MB will be skipped and not returned by this trigger. |
When a file is modified (properties only) |
This operation triggers a flow when a file is modified in a folder. |
When a file is modified (properties only) [DEPRECATED] |
This action has been deprecated. Please use When a file is modified (properties only) instead.
|
When a file is modified [DEPRECATED] |
This action has been deprecated. Please use When a file is modified instead.
|
This operation triggers a flow when a new file is created in a folder. Files larger than 50 MB will be skipped and not returned by this trigger. Files moved within OneDrive are not considered new files.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
Folder
|
folderId | True | string |
The unique identifier of the folder. |
Include subfolders
|
includeSubfolders | boolean |
Include items in subfolders |
|
Infer Content Type
|
inferContentType | boolean |
A boolean value (true, false) to infer content-type based on extension. |
Returns
The content of the file.
- File content
- binary
This operation triggers a flow when a new file is created in a folder. Files moved within OneDrive are not considered new files.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
Folder
|
folderId | True | string |
The unique identifier of the folder. |
Include subfolders
|
includeSubfolders | boolean |
Include items in subfolders |
|
Number of files to return
|
maxFileCount | integer |
Maximum number of files to return by single trigger run (1-100). Note that 'Split On' setting can force trigger to process each item individually. |
Returns
Blob metadata
- List of Files
- BlobMetadata
This action has been deprecated. Please use When a file is created (properties only) instead.
This operation triggers a flow when a new file is created in a folder. Files moved within OneDrive are not considered new files.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
Folder
|
folderId | True | string |
The unique identifier of the folder. |
Number of files to return
|
maxFileCount | integer |
Maximum number of files to return by single trigger run (1-100). Note that 'Split On' setting can force trigger to process each item individually. |
Returns
Blob metadata
- List of Files
- BlobMetadata
This action has been deprecated. Please use When a file is created instead.
This operation triggers a flow when a new file is created in a folder. Files larger than 50 MB will be skipped and not returned by this trigger. Files moved within OneDrive are not considered new files.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
Folder
|
folderId | True | string |
The unique identifier of the folder. |
Infer Content Type
|
inferContentType | boolean |
A boolean value (true, false) to infer content-type based on extension. |
Returns
The content of the file.
- File content
- binary
This operation triggers a flow when a file is deleted from a folder.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
Folder
|
folderId | True | string |
The unique identifier of the folder. |
Include subfolders
|
includeSubfolders | boolean |
Include items in subfolders |
Returns
Blob metadata
- List of Files
- BlobMetadata
This operation triggers a flow when a file is modified in a folder. Files larger than 50 MB will be skipped and not returned by this trigger.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
Folder
|
folderId | True | string |
The unique identifier of the folder. |
Include subfolders
|
includeSubfolders | boolean |
Include items in subfolders |
|
Infer Content Type
|
inferContentType | boolean |
A boolean value (true, false) to infer content-type based on extension. |
Returns
The content of the file.
- File content
- binary
This operation triggers a flow when a file is modified in a folder.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
Folder
|
folderId | True | string |
The unique identifier of the folder. |
Include subfolders
|
includeSubfolders | boolean |
Include items in subfolders |
|
Number of files to return
|
maxFileCount | integer |
Maximum number of files to return by single trigger run (1-100). Note that 'Split On' setting can force trigger to process each item individually. |
Returns
Blob metadata
- List of Files
- BlobMetadata
This action has been deprecated. Please use When a file is modified (properties only) instead.
This operation triggers a flow when a file is modified in a folder.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
Folder
|
folderId | True | string |
The unique identifier of the folder. |
Number of files to return
|
maxFileCount | integer |
Maximum number of files to return by single trigger run (1-100). Note that 'Split On' setting can force trigger to process each item individually. |
Returns
Blob metadata
- List of Files
- BlobMetadata
This action has been deprecated. Please use When a file is modified instead.
This operation triggers a flow when a file is modified in a folder. Files larger than 50 MB will be skipped and not returned by this trigger.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
Folder
|
folderId | True | string |
The unique identifier of the folder. |
Infer Content Type
|
inferContentType | boolean |
A boolean value (true, false) to infer content-type based on extension. |
Returns
The content of the file.
- File content
- binary
Blob metadata
Name | Path | Type | Description |
---|---|---|---|
Id
|
Id | string |
The unique identifier of the file or folder. |
Name
|
Name | string |
The name of the file or folder. |
Name without extension
|
NameNoExt | string |
The name of the file or folder, without the file extension. |
Display name
|
DisplayName | string |
The display name of the file or folder. |
Path
|
Path | string |
The path of the file or folder. |
Last modified time
|
LastModified | date-time |
The date and time the file or folder was last modified. |
Size
|
Size | integer |
The file or folder size in bytes. |
Media type
|
MediaType | string |
The media type of the file or folder. |
Is folder?
|
IsFolder | boolean |
A boolean value (true, false) to indicate whether or not the blob is a folder. |
ETag
|
ETag | string |
The etag of the file or folder. |
File locator
|
FileLocator | string |
The file locator of the file or folder. |
Last modified by
|
LastModifiedBy | string |
The user who last modified the file or folder. |
Name | Path | Type | Description |
---|---|---|---|
Web URL
|
WebUrl | string |
A URL that points to the file or folder. |
Tags
Name | Path | Type | Description |
---|---|---|---|
Tags
|
Tags | array of string |
A list of tags. |
Thumbnail response data
Name | Path | Type | Description |
---|---|---|---|
Url
|
Url | string |
A URL that points to the thumbnail. |
Width
|
Width | integer |
The thumbnail width in pixels. |
Height
|
Height | integer |
The thumbnail height in pixels. |
Represents a page of blob metadata.
Name | Path | Type | Description |
---|---|---|---|
value
|
value | array of BlobMetadata |
Blob metadata collection. |
nextLink
|
nextLink | string |
A URL which can be used to retrieve the next page. |
This is the basic data type 'binary'.