Is it possible to change an existing file's extension in a SP document library? I have seen many example on renaming the file's name but not the actual extension. For example is a file's name is file.html can i change it to file.aspx without having to create a new file and deleting the old one? Thanks!
Hi @skarthanal ,
I am not aware of an action for simply changing the file type with one action in Power Automate. you can Create a new file with the content and just pass in file name the new format with a concat() function. You can use directly Name with .xlsx like in my screenshot or use an expression
concat(FileName,‘.docx‘)
Thank you your response, I was aware of this but i was looking to retain the document id and not have to create a new one and delete the old file.
Maybe you can use the SharePoint API with the Send HTTP Request to SharePoint action.
maybe you can go with that approach
I tried this and got the flow to work however, it is not working as we expect. If the file already stored in the library is <FileName.aspx> and i want to change it to <NewFile.txt> the flow will run successfully but it only changes the file's name not the extension. I end up getting NewFile.html
Are you also passing in the extensions ?
I made a quick research and also found that it Wald solved with another api endpoint, maybe that helps https://powerusers.microsoft.com/t5/General-Power-Automate/Renaming-SharePoint-file-using-REST-API-w...
Yes i am passing the filename and extension within the body liek below. I even tried the new endpoint and it doesnt not change the actual extension.
{
"formValues":[
{
"FieldName":"FileLeafRef",
"FieldValue":"Filename.txt"
}
]
}
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
62 | |
22 | |
16 | |
16 | |
11 |
User | Count |
---|---|
133 | |
43 | |
32 | |
32 | |
28 |