Using the One Drive actions in a loop

Use the Find files and folder action to return a table of files and their properties inside of a specified folder, the Loop action to loop through each row in the table, and a One Drive action to perform an operation on every file in the table.

Procedure

To perform an action on every file in a folder, do the following steps:

  1. Double-click or drag One Drive > Find files and folders.
  2. Provide your username with either a credential variable or an unencrypted value.
  3. Enter the file path of the folder in which to perform the search.
  4. Select the All items in folder option.
    You can alternatively select Specific file (or folder) to limit the search to a specific folder on your OneDrive.
  5. Select or create a table variable to hold the output.
    The table variable holds information on files and folders in rows, under the following columns: name, id, createdBy, creationDate, lastModifiedBy, lastModificationDateTime, parentFolder, and Path.
  6. Double-click or drag the Loop action.
  7. Select the For each row in table iterator.
  8. Select the table variable holding the output from step 5.
  9. Select or create a record variable to temporarily hold each row.

Insert the action inside of the Loop container that you want to repeat on every file in the folder. This example uses the Download file action.

  1. Double-click or drag Outlook > Download file.
  2. Provide your username with either a credential variable or an unencrypted value.
  3. Enter the following in the File name including path field, replacing the generic variable names with the names of the record variables from step 10:
    $RecordVariable[7]$/$RecordVariable[0]$
  4. Enter the path to the folder where to download the files.
  5. Click Save.