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 / automatic save the fil...
Power Automate
Answered

automatic save the file attached to an email

(1) ShareShare
ReportReport
Posted on by

Hi all.

i've a problem with a flow.

i want to save in a folder on Onedrive for business a file attached in an email that i receive all the day.

in order to filter the correct email i only have to as a parameter the object of the email.

The object is:  "Pippo_gg/mm/aaaa_other word...."

Every days obviously the date change and so i can't insert the exacte object of each email but i need to insert a parameter in the object.

It's possible?

Thanks

Andrea

Categories:
I have the same question (0)
  • trice602 Profile Picture
    16,298 Super User 2026 Season 1 on at

    Hi @andler67 ,

     

    Yes this is possible - if you can describe an example sample what this would look like (for today as an example), I can give you some framework to make your own.

     

    What does this describe?  Pippo_gg/mm/aaaa_other word
     
    And where does the date play into this?
     
     
     
     
  • AL-23070616-0 Profile Picture
    on at

    Pippo_09/02/2024_solar_panel

    Pippo_10/02/2024_solar_panel

    Pippo_11/02/2024_solar_panel

    And so on

  • trice602 Profile Picture
    16,298 Super User 2026 Season 1 on at

    Hi @andler67 ,

     

    Here's a flow that will check if the attachment name contains "Pippo_" and if true, save the attachment to OneDrive, else do nothing.

     

    trice602_0-1707575652717.png

     

     

    trice602_1-1707575709474.png

     

     

     

    To limit the flow runs, I am only running this on emails with attachments.

     

    trice602_2-1707575783060.png

     

     

  • AL-23070616-0 Profile Picture
    on at

    Sorry

    The problem is that i have the following object in the emails:

     

    "Pippo_09/02/2024_solar_panel"     ok. attached file to be saved

    "Pippo_10/02/2024_solar_panel"     ok. attached file to be saved

    "Pippo_11/02/2024_solar_panel"     ok. attached file to be saved

    "Pippo_02/2024_solar_panel"               attached file NOT to be saved

    "Pippo_2024_solar_panel"                    attached file NOT to be saved

     

    The numbers means

     

    dd/mm/yyyy    or

    mm/yyyy or

    yyyy

  • Verified answer
    Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @andler67 

     

    in addition to what @trice602  has explained here, you have to add few more conditions n condition action apart from checking whether file name has Pippo_ as value like below

    Nived_Nambiar_0-1707656500786.png

     

    1. First condition check whether attachment name is having Pippo_

    2. Second condition checks whether the date part after Pippo is having 10 characters using length expression

    Nived_Nambiar_1-1707656575688.png

     

    Expression-  length(split(items('Apply_to_each')?['name'],'_')?[1])

     

    3. Third condition checks whether the date component has 3 parts - day, month and year using splitting by / like below

    Nived_Nambiar_2-1707656644122.png

     

    Expression: - length(split(split(items('Apply_to_each')?['name'],'_')?[1],'/'))

    4. fourth condition checks whether the date part after removing / is a perfect numbe or not 

    Nived_Nambiar_3-1707656723693.png

     

    Expression:  isInt(replace(split(items('Apply_to_each')?['name'],'_')?[1],'/',''))

     

     

    I think adding this conditions can help to filter the attachments as well.

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

     

  • AL-23070616-0 Profile Picture
    on at

    Thank you very much.

    Your solution suggested me another solution

    with the lenght of the object (92 caracters) i filter correctly the email.

    Tomorrow i can test if it works well.

    Thank you very much

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 481

#2
11manish Profile Picture

11manish 278

#3
David_MA Profile Picture

David_MA 276 Super User 2026 Season 1

Last 30 days Overall leaderboard