web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power Automate to Save...
Power Automate
Unanswered

Power Automate to Save Files from E-mail Attachments

(0) ShareShare
ReportReport
Posted on by

Hello all,

 

New to power automate and well I am figuring it out but it is taking a toll.  I have created a Flow that saves attachments from my email account to a folder located in my OneDrive.  This works.  However my hurdle is that I have several TXT files in my emails at one time.  I need to save those files to a static name IE ReportFlow.Txt however the file is constantly written with the actual attachments name when there is more than one TXT file.  I used this to get this far.


ReportFlow(Expression).txt

Expression:

concat(split(items('Apply_to_each_Attachment_on_the_email')?['Name'], '.')[0], '-1', slice(items('Apply_to_each_Attachment_on_the_email')?['Name'], indexOf(items('Apply_to_each_Attachment_on_the_email')?['Name'], '.')))


How can I append a numerical value to the Static Name when there are multiple files to save at the same time?  ReportFlow-1.txt ReportFlow-2.txt  and not when I am getting ReportFlowCrazyLongAttachmentNamefromEmail-1.txt and ReportFlowCrazyLongAttachmentNamefromEmail-2.txt

 Thanks

Categories:
I have the same question (0)
  • creativeopinion Profile Picture
    10,508 Moderator on at

     What if you append a timestamp to the file instead? I cover how to do that in this YT Tutorial: Save Email Attachments to SharePoint with Microsoft Power Automate

     

    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 

     

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution .
    Consider giving me a 👍 if you liked my response! If you're feeling generous— ️  Buy me a coffee: https://www.buymeacoffee.com/acreativeopinion

    👉 Watch my tutorials on YouTube
    👉 Tips and Tricks on
    TikTok

    @James_Robertson

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 605

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard