Productivity Activities
Last updated Jul 9, 2024

For Each File or Folder



Executes one or more activities for each file or folder in a specified folder.

Note: This activity uses pagination for processing large numbers of items and mitigating performance issues. This activity doesn't support persistence.

This activity requires the following scopes:


Project compatibility

Windows | Cross-platform


  • Google Drive connection - The connection for the Google Workspace account to use in the activity.
  • In location - The location where to search for files and folders. Default value: My Drive. If left blank, the activity searches anywhere in Google Drive.
    • Use the See more button menu to switch to Use variable (IResource type) or Url or ID input (String) modes.
    • Select the Reload File Picker option if you've modified your folders and need to retrieve the latest data.

  • Body - Activities added in this section are executed for each file or folder found in the selected location.
Additional options


  • Limit to first - Select the number of files or folders to iterate through. By default, 200 is selected. This field supports Int32 variables and Int32 values.
  • What to return - Specifies whether to return only files, only folders, or both files and folders. By default, Files and folders is selected.
  • Starred only - Specifies whether to consider only starred files and folders. This field supports Boolean values. By default, False is selected.
  • Additional filters - Click this field to open the Filter builder and add additional filters for the query. Supports filtering on the following fields: Creation date and time, Last modified date and time, Name, Owner, Text in file, Type.


  • Number of files/folders processed - The total number of items processed by the activity. Automatically generated output variable. You can use it as it is or save it with a different name. Can be used outside the For Each File/Folder activity.

Batching API calls is supported for the following activities when used inside the For each:


See also:
  • Description
  • Project compatibility
  • Configuration
  • Example

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.