In UiPath Studio development, there are cases where you want to manipulate files and folders located on OneDrive or SharePointOnline in Office365.
This article describes how to manipulate files and folders located on Office365 using Microsoft Office365 Activities.
\Save during the sale period!/
Take a look at the UiPath course on the online learning service Udemy
*Free video available
Related Articles Learn the Creation Techniques f UiPath robotics creation with Udemy’s online courses that take it up a notch
This site was created by translating a blog created in Japanese into English using the DeepL translation.
Please forgive me if some of the English text is a little strange
How to Prepare and Use Office365 Activities
How to Install Office365 Activities
Microsoft Office365 Activities are not present in the process created by default.
A separate MicrosoftOffice365.Activities activity package must be added.
For instructions on how to install Microsoft Office365 Activities, please refer to the Installing the Office365 Activities Package article.
How to use Office365 Activities
Each Office365 activity is used by placing the activity within the “Microsoft Office 365 Scope” or “Use OneDrive and SharePoint”.
The “Microsoft Office 365 Scope” is recommended since all activities under the “Integration>Microsoft>Office365” can be used.
However, “App Registration” must be configured for AzureAD.
“Use OneDrive and SharePoint” only uses activities under the “Integration>Microsoft>Office365>Files” and can only manipulate files on Office365.
List of file manipulation activities in Office365
Activities that manipulate Office365 files can be found under “Integration>Microsoft>Office365>Files”.
The following table shows the activities under “Integration>Microsoft>Office365>Files”.
Activity Location | Activity Name | What you can do in Activities |
Integrations> Microsoft> Office365> Files |
Use OneDrive & SharePoint | Selects an account to use for OneDrive and SharePoint automation. After you add this activity, add the activities that work with files from OneDrive and SharePoint in Use OneDrive & SharePoint. |
Copy File/Folder | Uses the Microsoft Graph Copy item API to create a copy of a file or folder and add it to the same or a new parent folder (Destination folder). | |
Share File/Folder | Uses the Microsoft Graph Create sharing link and Add permissions APIs to share a file or folder drive item with the specified recipients. | |
Delete File/Folder | Uses the Microsoft Graph Delete item API to delete a specified file or folder in your OneDrive or SharePoint site (DriveItem). | |
Get File/Folder | Uses the Microsoft Graph Get item API to get the metadata of a specified item with a known ID (ItemID). | |
Move File/Folder | Uses the Microsoft Graph Move item API to move a specified file or folder to a new parent folder (Destination folder) with the option to change its name. | |
Find Files And Folders | Uses the Microsoft Graph Search items and Shared files APIs to find the files, metadata, and/or contents that match the values of your search parameters (Query). | |
Export File as PDF | Uses the Microsoft Graph Convert content API to convert a OneDrive or SharePoint file to a PDF and save it to a local location. | |
Upload File | Uses the Microsoft Graph Resumable upload API to upload a local file to your OneDrive or SharePoint account. | |
Download File | Uses the Microsoft Graph Download file API to download a specified file from your OneDrive or SharePoint site to a local location. | |
Create Folder | Uses the Microsoft Graph Create folder API to create a new folder (FolderName) in a specified parent directory (Destination folder). | |
For Each File/Folder | Uses the Microsoft Graph Microsoft Search API to perform an activity or a series of activities on each file/folder that matches the filter criteria. |
Manipulate files and folders on Office365
To manipulate files and folders on OneDrive and SharePointOnline in Office365, use the activity under “Integration>Microsoft>Office365>Files”.
Find Files And Folders
To work with files and folders located on OneDrive or SharePointOnline, first search for the “Find Files And Folders” activity to obtain the “Microsoft.Graph.DriveItem”.
The retrieved DriveItem can then be used in other activities to copy, delete, etc.
Find Files And Folders setting items
設定場所 | 設定項目 | 設定内容 | |
Properties | Common | DisplayName | The display name of the activity. |
Input | Query | Defines the free text search phrase for the files or folders to retrieve. | |
Subfolder | (Optional) The path of a subfolder in which to search (e.g. SomeFolder or SomeFolder/Another/OneMore). | ||
Misc | Private | If selected, the values of variables and arguments are no longer logged at Verbose level. | |
Output | First | The first file or folder matching the specified query. | |
Results | All files and folders matching the query returned as an array of DriveItems. | ||
Sharepoint | Drive Name | The name of the drive within OneDrive or SharePoint searched for the indicated files or folders. | |
Site Url | The URL of the SharePoint site searched for the indicated files or folders. |
Search for folders in the target list of SharePointOnline and display the retrieved DriveItem in the log message.

・Variables
・Properties of Microsoft Office 365 Scope
・Properties of Find Files And Folders
・Properties of For Each
・Properties of Log Message drListItem
・Folder of SPO list to be searched
・Execution Result Log
Search for the target folder in OneDrive and display the retrieved DriveItem in the log message.

・Variables
・Properties of “Microsoft Office 365 Scope”
・Properties of “Find Files And Folders”
・Properties of “For Each”
・Properties of “Log Message drListItem”
・Folders to search in OneDrive
・Execution Result Log
Copy File/Folder
To copy files and folders in OneDrive or SharePointOnline, first search for the files and folders in the “Find Files And Folders” activity and get them as “Microsoft.Graph. The following is a list of the most common ways to use this function.
Next, the acquired DriveItem can be used in “Copy File/Folder” to copy the file.
Copy File/Folder setting items
Setup Location | Setting items | Setting details | |
Properties | Common | DisplayName | The display name of the activity. |
Input | Destination folder | The directory to which this item is copied as a DriveItem. | |
File or folder to copy | The file or folder to copy as a DriveItem. | ||
New name (optional) | The name of this item after it is copied. | ||
Misc | Private | If selected, the values of variables and arguments are no longer logged at Verbose level. | |
Output | DriveItem Copy | The new file or folder as a DriveItem. |
Copy files in SharePointOnline to another folder.
・Variables
・Properties of “Microsoft Office 365 Scope”
・Properties of “Find Files And Folders target file for copy
・Properties of “Find Files And Folders destination folder
・Properties of “Copy File/Folder”
・Files to be copied
・Destination folder
・Destination folder after workflow execution
Move File/Folder
To move files and folders in OneDrive or SharePointOnline, first search for the files and folders in the “Find Files And Folders” activity and get them as “Microsoft.Graph. The following is a list of the most common ways to use this function.
The retrieved DriveItem can then be used in “Move File/Folder” to move the file.
Move File/Folder setting items
Setup Location | Setting items | Setting details | |
Properties | Common | DisplayName | The display name of the activity. |
Input | Destination folder | The directory to which this item is moved as a DriveItem. | |
File or folder to move | The file or folder to move as a DriveItem. | ||
New name (optional) | The name of this item after it is moved. | ||
Misc | Private | If selected, the values of variables and arguments are no longer logged at Verbose level. | |
Output | Reference as | The file or folder and its new location as a DriveItem. |
Move the target file in OneDrive to another folder and rename it.
・Variable
・Properties of “Microsoft Office 365 Scope”
・Properties of “Find Files And Folders Files to be moved”
・Properties of “Find Files And Folders Destination Folder”
・Properties of “Move File/Folder”
・Files to be copied
・Destination folder
・Folder of files to be moved after workflow execution
・Destination folder after workflow execution
Delete File/Folder
To delete a file or folder in OneDrive or SharePointOnline, first search for the file or folder in the “Find Files And Folders” activity and retrieve it as a “Microsoft.Graph.DriveItem”.
Next, the acquired DriveItem can be used in “Delete File/Folder” to delete the file or folder.
Delete File/Folder setting items
Setup Location | Setting items | Setting details | |
Properties | Common | DisplayName | The display name of the activity. |
Input | File or folder to delete | The DriveItem of the file or folder to delete. | |
Misc | Private | If selected, the values of variables and arguments are no longer logged at Verbose level. |
Delete the target file on SharePointOnline.
・Variable
・Properties of “Microsoft Office 365 Scope”
・Properties of “Find Files And Folders”
・Properties of “Delete File/Folder”
・Folder where the file to be deleted is stored
・Folder where files to be deleted after workflow execution are saved
Create Folder
To create a folder on OneDrive or SharePointOnline, use the “Create Folder” activity.
Create Folder
Setup Location | Setting items | Setting details | |
Properties | Common | DisplayName | The display name of the activity. |
Input | Folder name | A name for the created folder. | |
Destination folder | The DriveItem of the directory in which this folder is created. | ||
Misc | Private | If selected, the data used in the activity is not logged by Studio. | |
Output | Reference as | The created folder as a DriveItem object. |
Create a folder directly under OneDrive.
・variable
・Properties of “Microsoft Office 365 Scope”
・Properties of “Create Folder”
・Directly under OneDrive before workflow execution
・Directly under OneDrive after workflow execution
Upload File
To upload a file to OneDrive or SharePointOnline, first use the “Find Files And Folders” activity to find the folder where the file will be uploaded and retrieve it as a “Microsoft.Graph.DriveItem”.
The retrieved DriveItem can then be used in Upload File to upload the file.
Upload File setting items
Setup Location | Setting items | Setting details | |
Properties | Common | DisplayName | The display name of the activity. |
Input | Conflict Behavior | Indicates the conflict resolution behavior in case a file with the same name already exists. | |
Destination folder | The parent folder to which the file is uploaded as a DriveItem. | ||
File to upload | The path to a local file to upload. | ||
Metadata | The metadata to associate with the resulted DriveItem (it works only for a DriveItem stored in a SharePoint Document Library). | ||
New name (optional) | A new name for the uploaded file. | ||
Misc | Private | If selected, the values of variables and arguments are no longer logged at Verbose level. | |
Output | Reference as | The uploaded file as a DriveItem. |
Upload files on the designated folder in ShraPoint.
・Variable
・Properties of “Microsoft Office 365 Scope”
・Properties of “Find Files And Folders”
・Properties of “Upload File”
・SharePoint upload destination folder
・Destination folder for SharePoint uploads after workflow execution
Download File
To download a file from OneDrive or SharePointOnline, first search for the file to be downloaded in the “Find Files And Folders” activity and retrieve it as a “Microsoft.Graph.DriveItem”.
Next, the file can be downloaded by using the retrieved DriveItem with “Download File”.
Download File setting items
Setup Location | Setting items | Setting details | |
Properties | Common | DisplayName | The display name of the activity. |
Input | File to download | The DriveItem of the file to download. | |
Download as file | The local path to which the file is downloaded. If left blank, the project directory is used. | ||
Misc | Private | If selected, the values of variables and arguments are no longer logged at Verbose level. |
Download the specified file on SharePoint.
・Variable
・Properties of “Microsoft Office 365 Scope”
・Properties of “Find Files And Folders”
・Properties of “Download File”
・Files to be downloaded
・Destination folder for download after workflow execution
summary
- To manipulate files and folders on Office365 SharePoint and OneDrive, first install the MicrosoftOffice365.Activities activity package.
- Place “Microsoft Office 365 Scope” or “Use OneDrive and SharePoint” in the workflow for manipulating Office365 files and place “Integration>Microsoft>Office365>Files” in it.
- Find Files And Folders” activity to search for target files and folders, and use the results obtained as “Microsoft.Graph.DriveItem” type in other activities to manipulate files and folders.
\Save during the sale period!/
Take a look at the UiPath course on the online learning service Udemy
*Free video available
Related Articles Learn the Creation Techniques f UiPath robotics creation with Udemy’s online courses that take it up a notch
same category UiPath

Japanese IT engineer with a wide range of experience in system development, cloud building, and service planning. In this blog, I will share my know-how on UiPath and certification. profile detail / twitter:@fpen17