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 Files with File...
Power Automate
Answered

Create Files with File Extension from a List

(0) ShareShare
ReportReport
Posted on by

I have built a flow that takes the files (attachments) from a SharePoint list and exports them to a document library.  The flow is working perfectly except that none of the resulting files have a file type extension.  Since the list could include .pdf, .xlsx, .docx, etc., I need a way to identify the file type from the list and dynamically append the extension to my name in the "Create File" block.

Here are the steps leading up to the file creation in my flow.  Up to this point, it is working exactly as I want it to

 

afdepm_0-1684972767741.png

 

EDIT:  I have "File Name with Extension" as the last value in creating the file name in the library, but it does not successfully append to the outputted file.  I expected if the attachment was named "contract.pdf" and I put that at the end of the name syntax, I would get Location_Document Number_Status_contract.pdf.  What I get is Location_Document Number_Status_contract

Thank you for your help

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

    Hi @afdepm 

     

    You can get the file name using the 'DisplayName' output property from 'Get attachments' action. You don't need to use 'Get attachment content' action as you can use 'ID' output property from 'Get attachments' action to get the file content. Pls refer to the sample flow:

    ManishSolanki_0-1684986873934.png

    here, we are iterating all the attachments and creating a new file using DisplayName & ID property.

     

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

     

    Thanks

  • afdepm Profile Picture
    on at

    @ManishSolanki  Thank you, both for helping me simplify the flow as well as giving me the solution!

  • afdepm Profile Picture
    on at

    @ManishSolanki  I spoke too soon.  The PDFs all appear to be corrupted.  They open fine from the list, but after being exported via this flow, they do not open.

     

  • afdepm Profile Picture
    on at

    Restoring the "Get File Content" step and using "Attachment Content" in the Create File block seems to have fixed it.

    afdepm_0-1685106692309.png

     

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard