Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Create SharePoint File from Outlook Attachment Not Readable

(1) ShareShare
ReportReport
Posted on by 6

Hello Community,

 

Pretty straight-forward flow I am creating:

- Check for new email matching Subject Text String

- Move Excel attachment into a SharePoint location

Is outputting a file that is not in any sort of format and when I've tried added ".xlsx" into the "File Name" field, it has just created a corrupted Excel file. Any help?

1.PNG2.PNG3.PNG

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Create SharePoint File from Outlook Attachment Not Readable

    Hi,

     

    Pls use the original expression without making any changes. It dynamically extracts file extension from its name and append to subject of an email to set file name as <emailsubject.attachmentextension>

     

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

     

     

     

  • AnonPowerUser12 Profile Picture
    6 on at
    Re: Create SharePoint File from Outlook Attachment Not Readable

    In your example above, would you put the name of the file where I've marked in bold?

    concat(triggerOutputs()?['body/subject'],last(split(items('Apply_to_each')?['name'],'.')))

     With or without the quotations? 

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Create SharePoint File from Outlook Attachment Not Readable

    Hi,

     

    Here is an example of setting file name by joining email subject & attachment extension. You need write an expression for join operation. Expression needs to be added in the 'Function' box as shown below:

    ManishSolanki_0-1720707595207.png

    concat(triggerOutputs()?['body/subject'],last(split(items('Apply_to_each')?['name'],'.')))

     

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • AnonPowerUser12 Profile Picture
    6 on at
    Re: Create SharePoint File from Outlook Attachment Not Readable

    Is there a way to name the file whatever I want (Custom Text, Subject, TimeStamp, etc.) and include the file extension to make it work?

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Create SharePoint File from Outlook Attachment Not Readable

    As attachment name contains the full name of the file with extension so passing name fixed the issue. The subject of an email does not contain file name & extension so it did not work.

     

     

     

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

     

     

     

  • AnonPowerUser12 Profile Picture
    6 on at
    Re: Create SharePoint File from Outlook Attachment Not Readable

    It looks like it works when I follow your guide of naming the file "Name (Name of Attachment)" but not "Subject (Subject of Email)". Any idea why changing the file name would cause this to break?

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Create SharePoint File from Outlook Attachment Not Readable

    Hi @AnonPowerUser12 

     

    Pls use "Get attachment" action inside "Apply to each" action. Pass the Message ID & attachment ID as input values. 

    ManishSolanki_0-1720701639716.png

     

    In create file action, pass the file name & content as shown below:

    ManishSolanki_1-1720701743896.png

    ManishSolanki_2-1720701787165.png

     

     

    If you still face the issue, then switch to classic designer & retest the flow.

     

     

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492