- Overview
- Excel
- Release Notes
- About the Excel Activities Package
- Project Compatibility
- Project Settings
- Use Excel File
- Append Range
- Auto Fill
- Autofit Range
- Change Pivot Data Source
- Clear Sheet/Range/Table
- Copy/Paste Range
- Create Pivot Table
- Delete Column
- Delete Rows
- Delete Sheet
- Duplicate Sheet
- Export to CSV
- Fill Range
- Filter
- Filter Pivot Table
- Find First/Last Data Row
- Find/Replace Value
- For Each Excel Row
- For Each Excel Sheet
- Format As Table
- Format Cells
- Get Excel Chart
- Insert Column
- Insert Chart
- Insert Rows
- Insert Sheet
- Lookup
- Match Function
- Protect Sheet
- Read Cell Formula
- Read Cell Value
- Read Range
- Refresh Excel Data Connections
- Refresh Pivot Table
- Remove Duplicates
- Rename Sheet
- Run Spreadsheet Macro
- Save Excel File
- Save Excel File As
- Save Excel File As PDF
- Sort Range
- Text to Columns
- Unprotect Sheet
- Update Excel Chart
- VLookup
- Write Cell
- Write CSV
- Write DataTable to Excel
- Get Cell Color
- Invoke VBA
- Select Range
- Get Selected Range
- Excel Application Scope
- Append To CSV
- Read CSV
- Write CSV
- Delete Column
- Filter Table
- Get Table Range
- Insert Column
- Sort Table
- Append Range
- Close Workbook
- Get Cell Color
- Read Cell
- Read Cell Formula
- Read Column
- Read Range
- Read Row
- Select Range
- Set Range Color
- Write Cell
- Write Range
- Save Workbook
- Create Table
- Get Workbook Sheet
- Get Workbook Sheets
- Refresh Pivot Table
- Create Pivot Table
- Get Selected Range
- Copy Sheet
- Delete Range
- Auto Fill Range
- Copy Paste Range
- Execute Macro
- Insert/Delete Columns
- Insert/Delete Rows
- Invoke VBA
- LookUp Range
- Remove Duplicates Range
- Excel Process Scope
- Manage CSV Files
- Filter CSV Files
- Verify CSV Files
- Table Functions
- Manage Multiple Excel Files
- Interpret Excel Results
- Manage Pivot Tables
- Manage Range Selection
- Read From Excel Files
- Manage Databases in Excel
- Compare CSV Files
- Compare Numeric Values
- Sort Data in Excel Files
- Filter and Delete Rows in Excel Files
- Manipulate Range Selections
- Verify Excel Workbook Data
- Read, Write, and Append Data in Excel
- Google Workspace
- Release notes
- About the Google Workspace activities package
- Project compatibility
- Add Attendee
- Create Event
- Delete Event
- Modify Event
- Search Events
- Use Google Drive
- Share File
- Delete File Permission
- Get File Permissions
- Update File Permission
- Copy File
- Create Folder
- Delete File
- Download File
- Find Files and Folders
- Get File Info
- Move File
- Upload File
- Create Document
- Create New Spreadsheet
- Get Mail Messages
- Send Mail Messages
- Change Labels
- Use Google Spreadsheet
- Add Delete Columns
- Add Delete Rows
- Auto Fill Range
- Add New Sheet
- Append Row
- Batch Spreadsheet Updates
- Copy Sheet
- Copy Paste Range
- Delete Range
- Delete Sheet
- Get Cell Color
- Get Sheets
- Read Cell
- Read Column
- Read Range
- Read Row
- Rename Sheet
- Write Cell
- Write Range
- Clear Range
- Download Spreadsheet
- Use Google Document
- Batch Document Updates
- Get Document
- Get Text Index
- Insert Text
- Replace Text
- Read All Text
- Create Script Project
- Get Project Content
- Upload Script File
- Create Deployment
- Run Script
- Mail
- Microsoft 365
- Release notes
- About the Microsoft 365 activities package
- Project compatibility
- Merge multiple sheets into a new summary Excel sheet
- Automatically accept calendar invites from your manager
- Move files to dedicated folders by type
- Verify if new employment documents (I9 and ID) match
- Add new customers to a SharePoint List
- Delete SharePoint List items newer than yesterday
- Notify me on Slack when an important Outlook Email is received
- Include creation date in new OneDrive file names
- Notify me by email when a new file is created
- Add Sheet
- Append Range
- Clear Range
- Copy Range
- Copy Sheet
- Create Workbook
- Delete Range
- Delete Sheet
- Get Cell Color
- Get Sheets
- Read Cell
- Read Column
- Read Range
- Read Row
- Rename Sheet
- Write Cell
- Write Range
- Set Range Color
- Create Table
- Get Table Range
- Insert Column
- Delete Column
- Insert Rows
- Delete Rows
- VLookup Range
- Use OneDrive & SharePoint
- Copy File/Folder
- Create Folder
- Delete File/Folder
- Download File
- Export File as PDF
- Find Files And Folders
- Get File/Folder
- Move File/Folder
- Upload File
- Share File/Folder
- For Each File/Folder
- Forward Mail
- Get Mail
- Move Mail
- Send Mail
- Reply to Mail
- Delete Mail
- Set Mail Categories
- Add Attachment
- Add Attendee
- Add Location
- Create Event
- Delete Event
- Find Meeting Times
- Get Calendars
- Modify Event
- RSVP
- Search Events
- Create Group
- Delete Group
- Get Group
- List Groups
- Create Bucket
- Delete Bucket
- List Buckets
- List Bucket Tasks
- Create Plan
- Get Plan
- List Plans
- Create Task
- Delete Task
- Get Task
- List Tasks
- Update Task
- For Each List
- Get List Info
- For Each List Item
- Delete List Item
- Add List Items
- Update List Item
- Get List Items
- Presentations
- Word
For Each File or Folder
UiPath.MicrosoftOffice365.Activities.Files.ForEachFileFolderConnections
Iterates through a list of files and folders from OneDrive or SharePoint.
Add the activities to repeat inside For Each File/Folder and, when you configure the activities, select Use Variable > CurrentItem from the See more button menu to indicate that you want to repeat the actions for each item in the iteration.
Scopes
This activity requires the following scopes:
- Files.Read
- Files.ReadWrite
- Files.Read.All
- Files.ReadWrite.All
- Sites.Read.All
- Sites.ReadWrite.All
- Microsoft OneDrive & SharePoint connection - The connection for the Microsoft 365 account to use in the activity.
- In location - The location where to search for files and folders. The method to specify the file or folder to be retrieved: Enter Id, Enter Url or Use variable.
- Folder picker option - Browse the OneDrive or SharePoint folders and select a file or folder. This field accepts
IResource
input. -
Enter Id option:
- File or folder Id - The ID of the file or folder. To
retrieve the ID, open the file in OneDrive Web and retrieve its URL. The ID is
encoded in the URL. For example: if the URL is
https://yourcompany.sharepoint.com/Doc.aspx?sourcedoc=%7BA1CA7E78-BA59-4DD4-A6B9-5F5BBC37FA85%7D&file=Merge_sheets.xlsx
`, the decoded file ID isA1CA7E78-BA59-4DD4-A6B9-5F5BBC37FA85
.%7B
and%7D
are the delimiters around the file ID. This property supportsString
variables and string formatted values. - SharePoint site address - The URL of the SharePoint
site that contains the file or folder. Open your SharePoint site in a browser
and retrieve the URL, e.g.,
https://yourCompany.sharepoint.com/sites/Marketing
. This property supportsString
variables and string formatted values. - SharePoint document library - The document library
within the indicated SharePoint site that contains the file or folder. Open your
SharePoint site in a browser, go to the Documents tab, then retrieve the
URL, e.g.,
https://yourCompany.sharepoint.com/sites/Marketing/Shared%20Documents/Forms/AllItems.aspx
. This property supportsString
variables and string formatted values.
- File or folder Id - The ID of the file or folder. To
retrieve the ID, open the file in OneDrive Web and retrieve its URL. The ID is
encoded in the URL. For example: if the URL is
-
Enter Url option:
- File or folder Url - The URL of the file or folder. Open the file or folder in the browser and retrieve its URL. This property supports
String
variables and string formatted values.
- File or folder Url - The URL of the file or folder. Open the file or folder in the browser and retrieve its URL. This property supports
-
Use the See more button menu to use a variable or select the Reload Folder Picker option if you've modified your folders and need to retrieve the latest data.
- Folder picker option - Browse the OneDrive or SharePoint folders and select a file or folder. This field accepts
Additional options
Options
- Limit to first - The maximum number of files and folder to return. If left blank, there is no limit. This field supports
Int32
variables andInt32
values. - What to return - The types of results to return: both files and folders, only files, only folders.
- Trim duplicates - Boolean value. Set to
True
to remove duplicate files and folders from the search results. - Simple search - The query text used to search for files and folders across several fields (such as file name or file content). This property
supports
String
variables and string formatted values. Use the See more button menu to switch to Advanced search.Note: Simple Search is available for Business Accounts and Personal Accounts. Advanced Search is available only for Business Accounts and it includes the Include subfolders option. -
Advanced search - An advanced search criteria defined to filter the files and folders. This option isn't supported for personal Microsoft accounts. Advanced search uses the Filter builder to configure the search criteria.
- Include subfolders - Boolean value. Set to
True
to expand the search to all subfolders in the selected location.
- Include subfolders - Boolean value. Set to
Output
- Total number of files or folders processed - The total number of items processed by the activity. Can be used outside the For Each File/Folder activity. Automatically generated output variable. You can use it as it is or save it with a different name.
Body
The body of the activity that stores other activities used in the automation.
Filtering limitations
-
Filtering by File extension in the Filter builder might not work for extensions such as .avi, .svg, .gif, .ico, .jpeg, .jpg, .mov, .mp3, .mp4, .ogg, .png, .rtf, .tiff, .wav, .webm, .webp, or .wmv.
-
Filtering by Last modified by or Shared with user might return incomplete results.
-
The Graph API trims special characters from the beginning of a searched value. For example, if you search for "_Sorted", the API returns all files/folders whose name contains the word "Sorted", omitting the "_" character.
-
When iterating through files in the OneDrive root folder using Advanced search without any filters configured and even when Include subfolders is
False
, the activity may return all OneDrive files instead of just the OneDrive root folder’s files only. -
Due to a Microsoft limitation, Simple search doesn't identify image files. Use Advanced search instead, filtering by:
File or folder name contains .jpg
.
Batching API calls is supported for the following activities when used inside the For each: