
Picture this: every Monday morning, your team receives a batch of client reports dropped into a shared OneDrive folder. Someone — maybe you — has to manually open that folder, grab each file, and drag it into the appropriate SharePoint document library so the right people can access it. It takes 20 minutes you don't have, and if you forget, somebody's chasing you down by 10 AM. Now multiply that by every week of the year. That's over 17 hours of pure, mindless busywork.
Power Automate is Microsoft's workflow automation platform, and it's built exactly for problems like this. It connects your Microsoft 365 apps — OneDrive, SharePoint, Outlook, Teams, and more — with a visual, no-code interface that lets you define rules: when this happens, do that. You don't write traditional code. You build flows by connecting triggers (the event that starts the process) to actions (what actually happens). File copying and moving is one of the most practical and immediately satisfying things you can automate, and it's a perfect starting point for learning how Power Automate thinks.
By the end of this lesson, you'll have built real, working flows that handle file operations automatically — no more dragging and dropping by hand.
What you'll learn:
You'll need:
Before touching a single button, let's build a mental model. Power Automate works like a chain of dominoes. The first domino is the trigger — a specific event that starts the whole sequence. Every flow has exactly one trigger. The rest of the dominoes are actions — things Power Automate actually does in response.
For file automation, triggers usually sound like:
Actions sound like:
The important thing to understand is that Power Automate doesn't sit on your computer watching a folder the way you would. It runs in the cloud, on Microsoft's servers, and checks for trigger conditions continuously (usually within 1-5 minutes for file triggers). This is why you need cloud storage like OneDrive or SharePoint for the most reliable automation — not a folder on your desktop.
Note on "local" folders: Power Automate doesn't natively watch your local Windows desktop folders. The closest equivalent is to sync a OneDrive folder to your computer. When you put a file in that local synced folder, OneDrive uploads it to the cloud, and then Power Automate can detect it and act on it. We'll cover this approach later.
Let's build something real. The scenario: your finance team drops raw sales exports into a folder called Incoming in your OneDrive. You want every new file that lands there to be automatically copied to a Sales Archive folder. This gives you a backup without anyone lifting a finger.
Log in to flow.microsoft.com. In the left sidebar, click My flows, then click New flow in the top-left area. From the dropdown, select Automated cloud flow. This is the type that starts when something happens — our trigger-based approach.
A dialog box will appear. Give your flow a name — something descriptive like "Copy Sales Files to Archive" — and then in the search box under "Choose your flow's trigger," type OneDrive. You'll see a list of OneDrive triggers appear.
Select "When a file is created" (from the OneDrive for Business connector if you're on a work account, or the plain OneDrive connector for personal accounts). Click Create.
You'll now be in the flow designer, which looks like a canvas with connected cards. The first card is your trigger: When a file is created.
Click on the trigger card to expand its settings. You'll see a field labeled Folder. Click the small folder icon to browse your OneDrive. Navigate to and select the Incoming folder (create it first in OneDrive if it doesn't exist yet).
Tip: If you type the folder path manually, OneDrive paths start with a
/. So the Incoming folder at the root of your OneDrive would be/Incoming. Subfolders look like/Incoming/Finance.
That's all the trigger needs. It will now fire every time a new file appears in /Incoming.
Click the + New step button below the trigger card. In the search box, type OneDrive copy. Look for the action called "Copy file" under the OneDrive or OneDrive for Business connector (match whichever one you used for the trigger).
The Copy file action needs three things:
/Sales Archive in OneDrive first).Click Save in the top-right corner. Your flow is live.
Drop any file into your /Incoming OneDrive folder. Wait about 1-3 minutes. Then check your /Sales Archive folder — the file should appear there. You can also go back to My flows, click on your flow's name, and scroll down to see Run history. Each run will show as Succeeded or Failed, and you can click into any run to see exactly what happened at each step.
Right now your flow copies everything blindly. But dynamic content lets you make decisions based on the file itself. Let's look at a few useful patterns.
Suppose you want to preserve when the file arrived, so instead of copying sales_report.xlsx, you copy it as sales_report_2024-11-15.xlsx. In the New file name field of your Copy action, you can combine dynamic content with a function.
Click into the New file name field. Switch to the Expression tab in the dynamic content panel instead of the Dynamic content tab. Type:
concat(triggerOutputs()?['body/Name'], '_', formatDateTime(utcNow(), 'yyyy-MM-dd'))
This combines the original filename with an underscore and today's date. However, this will result in something like sales_report.xlsx_2024-11-15 — the extension ends up in the middle. To strip the extension and re-add it cleanly, you'd use a slightly more sophisticated expression, but for now the simpler pattern is fine for learning the concept.
Tip: The
triggerOutputs()?['body/Name']expression is Power Automate's way of grabbing a property from the trigger data. The?is a null-safe operator — it prevents the flow from crashing if that property happens to be empty.
What if you only want to copy .xlsx files and ignore everything else? After your trigger, add a Condition action (search for "Condition" in the action search). Set it up like this:
triggerOutputs()?['body/Name'].xlsxIf the condition is true, put your Copy action inside the Yes branch. If false, you can just leave the No branch empty or add a different action (like logging to a spreadsheet). Now your flow is selective.
Copying is safe — the original stays put. But moving is often what you really want: once a file has been processed, archive it somewhere else and remove it from the inbox so you're not staring at a cluttered folder.
Moving in Power Automate is a two-step process: copy to the destination, then delete the original. There's no single "Move" action in most connectors, so you chain these two actions together.
Your team uploads vendor invoices to a OneDrive folder called Invoice Inbox. You want them automatically moved to a SharePoint document library called Processed Invoices in your Finance site, organized by the current year and month (so files end up in a path like Processed Invoices/2024/November).
Start a new Automated cloud flow. Use the same "When a file is created" OneDrive trigger, pointing to /Invoice Inbox.
Step 1 — Copy to SharePoint:
Add a new step and search for "Create file" from the SharePoint connector (not "Copy file" — SharePoint uses a different action pattern). The Create file action needs:
https://yourcompany.sharepoint.com/sites/Finance. Click the dropdown — Power Automate will list sites your account has access to./Processed Invoices/ and then use the expression tab to add the year and month dynamically:/Processed Invoices/
Then to make the subfolder dynamic, you'd use the expression formatDateTime(utcNow(), 'yyyy') for the year. In practice, you'd set the folder path field using an expression like:
concat('/Processed Invoices/', formatDateTime(utcNow(), 'yyyy'), '/', formatDateTime(utcNow(), 'MMMM'))
Step 2 — Delete the Original:
After the SharePoint Create file action, add another step. Search for "Delete file" from the OneDrive connector. In the File field, use the File identifier from the trigger. This removes the original from /Invoice Inbox.
Warning: Always get your copy/create step working and verified before adding the delete step. Test with non-critical files. A delete action is permanent — there's no undo in an automated flow.
Not everything needs to happen instantly. Sometimes you want to process files on a schedule — for example, every Friday at 5 PM, move everything in a staging folder to a final archive. This uses a Scheduled cloud flow instead of an automated one.
Create a new flow and select Scheduled cloud flow. Set the recurrence — say, every week on Friday at 5:00 PM in your time zone.
The challenge with scheduled flows and files is that your trigger fires regardless of whether any files exist. So you'll typically use the "List files in folder" action (from OneDrive or SharePoint) to get all current files, then use an Apply to each loop to process them one by one.
Here's the pattern:
The Apply to each loop is Power Automate's version of a for loop — it repeats the same set of actions for every item in a list.
As mentioned earlier, Power Automate can't natively watch a plain Windows folder. But here's the practical workaround:
C:\Users\You\OneDrive - Company\Drop Zone./Drop Zone, picks up the new file, and processes it.From the user's perspective, they're just dropping files into a local folder. The automation happens invisibly in the background. This pattern bridges the gap between traditional file system habits and cloud automation.
Build a complete file processing flow from scratch using the following scenario:
The scenario: Your marketing team uploads weekly social media performance reports (CSV files) to a OneDrive folder called Marketing Reports. You need each file to be:
Marketing Archive on your Marketing sitePROCESSED_ prepended to the filename so it's easy to identifyYour steps:
/Marketing ReportsMarketing Archive library, with filename set to concat('PROCESSED_', triggerOutputs()?['body/Name']) and file content from step 2Check your run history to confirm all three actions succeeded. If any step failed, click into it to read the error message — Power Automate's error details are usually quite specific about what went wrong.
"My flow never triggers"
The most common cause is pointing the trigger at the wrong folder path. OneDrive paths are case-sensitive and must start with /. Open your flow, edit the trigger, and use the folder picker rather than typing the path manually. Also check that you're saving the flow — unsaved flows don't run.
"The flow triggers but says 'File not found' on the copy/get content step" This usually happens when the file identifier from the trigger is stale or the file was moved before the flow ran. Make sure you're using the File identifier dynamic value (the internal ID), not the File path (which can change if a file is renamed). The ID is stable; the path is not.
"My files are being copied but the content is empty or 0 bytes" You're probably connecting the File Name dynamic value into the File Content field by mistake, or vice versa. Double-check that the File content field in your Create file action is receiving the output of the Get file content action, not a filename string.
"The flow runs multiple times for the same file" If multiple people are writing to the same file in quick succession (like a shared Excel workbook), the "file modified" trigger can fire several times. For copying flows, this is usually harmless. For moving/deleting flows, use a condition to check that the file still exists before deleting, or add a small delay action before the delete step.
"I don't see SharePoint sites in my dropdown" This is a permissions issue. Power Automate can only see SharePoint sites that your Microsoft 365 account has been granted access to. Ask your SharePoint site owner to add you as a member or visitor.
"Apply to each is running actions in parallel and causing conflicts" By default, Apply to each loops can run up to 20 iterations in parallel. For file operations where order matters, click on the three dots on the Apply to each header, go to Settings, and set concurrency control to 1 (sequential). This slows things down but prevents race conditions.
You've gone from understanding nothing about Power Automate to building flows that copy, move, and organize files automatically across OneDrive and SharePoint. Here's what you've mastered:
Where to go from here:
The best way to learn automation is to automate something you actually do every week. Find that 15-minute recurring task and build a flow for it. The investment takes an hour; the savings last forever.
Learning Path: Flow Automation Basics