
I have two flows that are to be pulling attachments from Outlook and saving them to folders in Onedrive each day.
Both flows appeared to be working when tested, but now when I go into the respective folders they only contain files uploaded from the previous day, rather than the whole week/month.
Each flow is setup the same way to grab emails with certain subject lines, that have attachments ending in certain formats, and then saving them (with timestamp appended to filename to avoid duplicates) in a certain folder in my Onedrive.
When I go into the Onedrive history it does show files being put into each folder daily, and there are no files in the recycling bin, so what is happening here? Is it possible that somehow the flow is creating a new folder with the same name and overwriting the old files?
Current setup:
When a new email arrives
For Each
Condition True/False
True (ends with .csv)
Save to folder in Onedrive
It's hard to say what's happening in your flow without seeing it. However, I would recommend that you set up Trigger Conditions for your flow. Without Trigger Conditions, your flow will trigger each time a new email arrives in your inbox. Instead, you can set up Trigger Conditions to only trigger your flow when a new email arrives and has attachments. You can get more specific if it's a CSV file from a specific email address.
This way, your flow won't trigger unnecessarily. Depending on how you are saving your files you could be overwriting your existing file. You should check your file's version history. Click on the three dots of your file and select Version History.
If your file has been overwritten, you will see all the versions listed. You can download any prev versions by clicking the three dots and selecting Download.
In the meantime, check out this YT Tutorial: Save Email Attachments to SharePoint with Microsoft Power Automate
Although this tutorial covers how to "download" attachments from email to SP—the same concepts can be applied for getting your attachments into OneDrive. Just select the appropriate OneDrive actions.
Power Automate doesn’t have a download attachment from outlook action. In this Power Automate Video tutorial, I’ll show you how to use the Get Attachment (V2) action in combination with the Create File action to get your email attachments onto SharePoint.
The Create File action will overwrite any files that already exist with the same name. In this tutorial, I’ll show you how you can append a timestamp to the end of a file name to prevent your file from being overwritten.
I’ll also show you how to set up your flow so that you can trigger it manually while building it so you don’t need to wait for an email to arrive. At the end of the video I’ll show you how adding trigger conditions to your flow can prevent it from triggering if certain conditions aren’t met. Although the final flow uses the When a new email arrives in a shared mailbox (V2) trigger, you can use any of the When a new email arrives triggers for your flow. Adjust this flow to suit your needs!
IN THIS VIDEO:
✅ How to Automate Downloading and Uploading Email Attachments to SharePoint
✅ How to Use a the Get Email (V2) action
✅ How to Use the Get Attachment (V2) action
✅ How to Create Attachment Files using the Create File Action
✅ How to Prevent the Create File Action from Overwriting a File
✅ How to use Split the Filename from its Extension
✅ How to Append a Timestamp to a File Name
✅ How to use the When a New Email Arrives in a Shared Mailbox (V2) trigger
✅ How to use the Convert Time Zone action
✅ How to add Trigger Conditions to your Flow