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 a file with Pow...
Power Automate
Unanswered

Create a file with Power Automate Flow but loses the extension file name

(2) ShareShare
ReportReport
Posted on by

Hello my friends, how are you?

 

Thanks again. You already helped me once and now I need one last bit of help to finish my work.

 

With the help of a friend here, I finished a flow within Power Automate that talks to Microsoft Lists and Microsoft Sharepoint.

Now, I've reached the final part, where the flow takes the contents of the attachment (or attachments) that the user includes when they create a new item. And the flow creates a new file in a specific folder in a specific Sharepoint library.

 

The creation is working perfectly!

But the file extension is lost when it creates the new file.

 

For example: If the user attaches a file called ASDFGHJKL.pdf and I want the stream to rename it to

FRIEND.pdf

the flow renames only to

FRIEND

without the extension (.pdf) at the end of the file

 

If the user attaches a file in PDF or PNG or JPEG or whatever, it renames the file correctly but loses the extension.

Can you help me?

1 (1).png

 

 

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    There should be a dynamic content field that includes the extension. Simply use that instead of Data Vencimento. I'm not sure what it would be called, but if you look at a recent run you should be able to see it in the output of the SharePoint action.

  • trice602 Profile Picture
    15,402 Super User 2025 Season 2 on at

    Hi @fabtodton40 ,

     

    I found a flow I had that does this.  I create a new variable and then in this set I am setting the variable using this expression split()

     

    trice602_0-1720191944509.png

     

    split(outputs('Get_Attachment_(V2)')?['body/name'], '.')[0]
     
    trice602_2-1720192143405.png

     

     
    slice(outputs('Get_Attachment_(V2)')?['body/name'], indexOf(outputs('Get_Attachment_(V2)')?['body/name'], '.'))
     
     
     
    trice602_1-1720192046825.png

     

     

     
  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    You would need to supply a '.' in front of the Atype or include it when creating the variable.  But you should be able to just use outputs('Get_Attachment_(V2)')?['body/name'] for the filename and have it include the extension.  You can still add additional information to the front of the new name.

  • trice602 Profile Picture
    15,402 Super User 2025 Season 2 on at

    @Pstork1 ,

     

    Agreed but most posts here want to append at the end of the file name, not the front so this was something I built a while back and works in testing but not sure if there is a more efficient way to do it.  

     

     

  • Verified answer
    fabtodton40 Profile Picture
    on at

    Thank you for the patience guys.

    I got it with this expression

     

    last(split(item()?['DisplayName'], '.'))

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard