COPY FOLDERS USING POWER AUTOMATE

How to Use Power Automate to Copy SharePoint Online Folders to a Document Library in Another SharePoint Online Site

  • Power Automate is a cloud-based service that allows you to create automated workflows between apps and services, including SharePoint Online. This guide provides step-by-step instructions on how to copy an entire folder (including its subfolders and files) from one SharePoint Online site to a document library in another SharePoint Online site.
  • This process assumes you are copying within the same Microsoft 365 tenant. Copying across tenants may require additional steps or third-party tools, which are not covered here.

Prerequisites

  • A Microsoft 365 account with access to Power Automate.
  • Contributor or higher permissions on both the source and destination SharePoint sites and document libraries.
  • The source folder must exist in a document library on the source site.
  • Familiarity with Power Automate basics (e.g., creating flows).
  • If you encounter permission issues, ensure your account has the necessary SharePoint permissions.

Step 1: Sign in to Power Automate

  1. Go to the Power Automate portal at https://make.powerautomate.com.
  2. Sign in with your Microsoft 365 credentials.
  3. If you are already logged in to Microsoft 365 and in a SharePoint site, you can click on the "waffle" menu link and select the "Power Automate" service from there too.

Step 2: Create a New Flow

  1. Click + Create in the left navigation pane.
  2. Select Instant cloud flow (for a manually triggered flow).
  3. Give your flow a name, such as "Copy SharePoint Folder to Another Site."
  4. For an instant flow, select Manually trigger a flow as the trigger and click Create.

This sets up a basic flow that you can trigger manually for testing.

Step 3: Add the "Copy Folder" Action

  1. Click + New step below the trigger.
  2. Search for "SharePoint" in the search bar and select the SharePoint connector.
  3. From the list of actions, select Copy folder.

Step 4: Configure the "Copy Folder" Action

Fill in the parameters as follows:

  • Current site address: Enter the URL of the source SharePoint site.
  • Folder to copy:
    • Click the folder icon on the right to browse and select the source folder from the document library.
  • Destination site address: Enter the URL of the destination SharePoint site.
  • Destination folder:
    • Click the folder icon to browse and select the target document library or subfolder where the copied folder should go.
    • If you want the folder copied to the root of the library, select the library root.
  • If another folder is already there: Choose one of the options:
    • Move with a new name: Renames the copied folder (e.g., adds a number) if a conflict occurs.
    • Fail this action: Stops the flow with an error if a folder with the same name exists.
    • Replace: Overwrites the existing folder in the destination.

Important Notes on Configuration:

  • The action will copy the entire folder, including all subfolders and files recursively.
  • Folder paths are for reference; Power Automate uses internal IDs, so avoid manual edits if possible.
  • If copying large folders, monitor for timeouts or limits.
  • For very large structures, consider breaking it into smaller flows or using a scheduled approach.

Step 5: Save and Test the Flow

  • Click Save at the top of the flow editor.
  • Click Test > Manually > Run flow.
  • Monitor the run history for success or errors. If successful, verify the copied folder in the destination library.
  • If errors occur (e.g., "Folder not found"), double-check URLs, paths, and permissions.

Troubleshooting Common Issues

  • Permission Denied: Verify your account has edit permissions on both sites.
  • Throttling/Limits: Power Automate has rate limits; for large copies, test in batches.
  • Duplicates in Root: If files appear duplicated, ensure you're only processing root items.