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 / Building flow to save ...
Power Automate
Answered

Building flow to save file in sharepoint under their subject name

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

Dear All,

I would need your urgent support on how to create the following flow:

 

Here is the situation:

  • I receive 7 file a day with different file names under same email subject
  • Currently I do it manually where I overwrite the files everyday

I need to build the following flow:

  • The flow should allow me to automatically store these files in Sharepoint, under the email subject name and not actual file name
  • this should be done daily at 7 A.M for all 7 files 
  • below is an example of how I receive the file and how I wanted to be stored

Meg_meg2_1-1651132236951.png

Meg_meg2_2-1651132296938.png

 

I really appreciate your support in advance!!

Please keep in mind that I am new to Power Automate and not an expert!

 

Thanks and regards.

Categories:
I have the same question (0)
  • GeorgiosG Profile Picture
    1,013 Super User 2024 Season 1 on at

    Hi @Anonymous ,

     

    as far as I understood your requirements right your flow should look like this:

    Screenshot 2022-04-28 at 13.27.03.pngScreenshot 2022-04-28 at 13.28.02.png

     

    Expressions I used in the Flow:

    split(string(items('Apply_to_each')?['name']),'.')

    concat(triggerOutputs()?['body/subject'],'.',last(variables('subjectName')))
     
    What we basically need to do here is split the attachments name and use '.' as separator. We need the ending / file type of this. Next is using concat to add to your subject name a '.' and the extension. 
     
    It will create each time a new file in your SharePoint library, if the file exists already it will overwrite and create a new version if versioning is enabled in your library.
    GeorgiosG_0-1651145430156.png

    Enabling versioning: https://support.microsoft.com/en-us/office/enable-and-configure-versioning-for-a-list-or-library-1555d642-23ee-446a-990a-bcab618c7a37

     

    In the trigger of the Flow you can be more precise and filter only Mails with special SubjectName, from special people etc...

     

    Hope this helps you 😉

     
     
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you for sharing: so basically this flow will ignore the actual name of file received bye email and this file name will be replaced with subject email?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Can you please share the final outcome of the flow you have shared (meaning file name received by email and how it is stored in sharepoint).

    thank you in advance and I appreciate your support!

  • GeorgiosG Profile Picture
    1,013 Super User 2024 Season 1 on at

    Yes Mail Subject will be new file name.

     

    47E2EBE5-88FD-49EE-95E2-88DA3FDE8714.jpegD059CC4B-C989-4532-91D5-CD023D461551.jpeg74ED2508-4C91-4B52-8D6E-5CB5FBEE6DE6.jpeg

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Dear GeorgiosG,

     

    I can see that you write the subjectName.xlsx in the field subjectName I need to apply this to seven files at once and not only one since every file has a different subject name. 

    Can above flow works or need to be ammended 

  • GeorgiosG Profile Picture
    1,013 Super User 2024 Season 1 on at

    Hi @Anonymous ,

     

    this flow will:

     

    • Create a document for each attachment in a mail
    • use the original file type
    • use the mail subject as file name 
    • if a mail has two attachments with the same file type, it will overwrite the file in SharePoint (or create a new version if versioning is enabled)
    • this flow works dynamically for all mails with attachments 

    Hope this helps you 😉

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Great that sounds exactly what I am looking for 

    One last question: will the flow run any time a new email email is received or do I have to schedule it.

    sorry I am still new to the Power Automate 

     

    thank you in advance 

  • Verified answer
    GeorgiosG Profile Picture
    1,013 Super User 2024 Season 1 on at

    It will run everytime you receive a mail, 👍 yes. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Dear Georgios

     

    First please find below how I set the initialize varibale for SubjectName and if it is correct?

    Meg_meg2_1-1652773772207.png

     

    My question is that the file will be saved under Email subject name which is in my case: AMCA0602 - SCHQFP 011 A-L A-W 06 06, is that correct? 

     

    Thank you a lot for the support!

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 957

#2
Valantis Profile Picture

Valantis 847

#3
Haque Profile Picture

Haque 609

Last 30 days Overall leaderboard