Delen via


OneDrive for Business

OneDrive for Business is a cloud storage, file hosting service that allows users to sync files and later access them from a web browser or mobile device. Connect to OneDrive for Business to manage your files. You can perform various actions such as upload, update, get, and delete files.

This connector is available in the following products and regions:

Service Class Regions
Logic Apps Standard All Logic Apps regions except the following:
     -   Azure China regions
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/onedrive-for-business

Known Issues and Limitations

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.

  1. 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 for Business 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.

  2. The maximum archive size for Extract archive to folder action is 50 MB and 100 files inside.

  3. The When a file is created or When a file is modified triggers will skip every file bigger than 50 MB.

  4. 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.

  5. 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.

  6. 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

  7. Multi-geo scenarios are not supported. Example: a user in contosoeu-my.sharepoint.com cannot access a file in contosoaus-my.sharepoint.com

  8. 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.

  9. Please note that certain policies can prevent users from using parts or all of the OneDrive for Business connector. The most common policies involve:

    • (Sharing) Prevent file download The OneDrive for Business 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 for Business 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 for Business connector resides on trusted Microsoft networks but can expatriate data.
  10. 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.

Note

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 for Business 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.

  1. 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.
  2. Cross-drive functionality is not supported in the OneDrive for Business 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.
  3. If you are getting an error while trying to create a connection, please make sure that you use the Microsoft business or school accounts instead of the Microsoft personal account.
  4. 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.
  5. 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.
  6. The Extract Archive to Folder action does not support multi-byte characters in the file name.
  7. Encrypted files saved on One Drive for business throws a corrupt file error. Even though the file can be opened manually.

Connector in-depth

For more information about the connector, see the in-depth section.

Throttling Limits

Name Calls Renewal Period
API calls per connection 100 60 seconds

Actions

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.

This operation creates a share link for a file.

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.

This operation creates a share link for a file using the path.

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 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.

This operation gets the list of files and subfolders in a folder.

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.

Update file

This operation updates a file.

Upload file from URL

This operation uploads a file from a URL to OneDrive.

Convert file (Preview)

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

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

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

Copy file

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

Copy file using path

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

Create file

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

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

Link scope
scope string

The scope of the link

Returns

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

Link scope
scope string

The scope of the link

Returns

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

Link scope
scope string

The scope of the link

Returns

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

Link scope
scope string

The scope of the link

Returns

Delete file

This operation deletes a file.

Parameters

Name Key Required Type Description
File
id True string

The unique identifier of the 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.

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

Find files in folder

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

Find files in folder by path

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

Get file content

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

Get file content using path

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

Get file metadata

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

Get file metadata using path

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

Get file thumbnail

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

List files in folder

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.

List files in folder [DEPRECATED]

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

List files in root folder

This operation gets the list of files and subfolders in the root folder.

Returns

Move or rename a file

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

Move or rename a file using path

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

Update file

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

Upload file from URL

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

Triggers

For a selected file

This trigger allows you to start a flow for a selected file in OneDrive for Business. (Available only for Power Automate.)

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.

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 [DEPRECATED]

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.

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.

This operation triggers a flow when a file is modified in a folder.

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 file is modified in a folder. Files larger than 50 MB will be skipped and not returned by this trigger.

For a selected file

This trigger allows you to start a flow for a selected file in OneDrive for Business. (Available only for Power Automate.)

Parameters

Name Key Required Type Description
operationId
operationId True string
host
host object
schema
schema True object
headersSchema
headersSchema object

Returns

Name Path Type Description
rows
body.rows array of object
filePath
body.rows.filePath string

The unique path of the file.

fileUrl
body.rows.fileUrl string

The URL to the source file.

User id
headers.x-ms-user-id-encoded guid

The unique identifier of the user who triggered the flow in AAD.

User email
headers.x-ms-user-email-encoded byte

The email address of the user who triggered the flow.

User name
headers.x-ms-user-name-encoded byte

The display name of the user who triggered the flow.

Timestamp
headers.x-ms-user-timestamp string

The time the flow was triggered.

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.

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

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.

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

When a file is created (properties only) [DEPRECATED]

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

When a file is created [DEPRECATED]

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

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.

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

When a file is modified (properties only)

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

When a file is modified (properties only) [DEPRECATED]

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

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

Definitions

BlobMetadata

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.

Thumbnail

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.

BlobMetadataPage

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.

binary

This is the basic data type 'binary'.