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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Create SharePoint File...
Power Automate
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

Categories:
I have the same question (0)
  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    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.

     

  • AnonPowerUser12 Profile Picture
    6 on at

    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,091 Super User 2025 Season 2 on at

    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

    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,091 Super User 2025 Season 2 on at

    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

    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,091 Super User 2025 Season 2 on at

    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.

     

     

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard