Power Automate: Rename SharePoint Files - a great intro to 'Send HTTP Request'

preview_player
Показать описание
There is no rename file action in the SharePoint data connection, so how are your getting Power Automate to rename your files? If you are creating a new file from the existing one, you are failing on fundamental document management policy and compliance.

In this video I introduce HTTP requests using file renaming as an example. We will rename the current file so you do not lose version and audit history besides many other things. Works with OneDrive files too.

HEADER CODE
------------------------
content-type application/json;odata=verbose
X-HTTP-Method PATCH
If-Match *

BODY CODE
-------------------
{'__metadata':
{'type': 'SP.Data.Shared_x0020_DocumentsItem'},
'Title':'Sample',

You can replace Title with another field name ore remove the entire row if it is not required.
Рекомендации по теме
Комментарии
Автор

Finally someone that tested there code and syntax before posting a video or blog!! The only issue I had was that I was getting the existing file name and then adding more info to it. One of the existing file names has an apostrophe in it, so the code above throws an error about an expected comma. Basically if you change the part after 'FileLeafRef': to have regular doulble quotes around it, it works great. 'FileLeafRef':"whatever stuff you need to put here"

johnpeterson
Автор

I've been looking for something like this for a long time. Thanks!!

ianjacobs
Автор

You are a legend John, this method also works for renaming folders 👏👏👏

pauljohnson
Автор

This was awesome. I struggled an entire day to find that it was this easy. It is not just file name the HTTP request can handle a lot more than that. Thank you so much.

hitarthpatel
Автор

You're not wrong about it probably not working first time. Just spent an hour trying to figure it out till I realised I had a colon instead of a semi-colon in the line Nice video, thanks

andytuke
Автор

Excellent video from an excellent teacher. I am in debt to many who share their knowledge through videos but you, sir, are an excellent teacher that explains not just what to do but what is happening behind the scenes. That's a gift. I would much rather know what I'm doing and why as opposed to just following steps blindly.
This is the best video I've seen on the topic. Now I just need to tweak this for renaming folders rather than files. Thank you particularly for building on the the _api bit showing how we can drill down into the lists. That will save lots of troubleshooting. Priceless.

djstone
Автор

Brilliant! This will save my bacon! Keep these tips and tricks coming. I've been sharing your link out! :-D

zystemautomated
Автор

Superb. Fixed a lot of issues for me.

barrydonovan
Автор

The best tutorial I never saw on that subject. Great job. Thank you

gillessylvestre
Автор

You uncovered a lot more than renaming files for me. I was not aware the SharePoint files and column data are in separate places. This explains a lot. Will you cover more "behind the scenes" of SharePoint libraries?

casperjday
Автор

All I want to say is, , , Thank you very much :)
You made it really easy . Very well explained.. and no BS.. all crisp, straight and simple to understand.

mahmedsheraz
Автор

BRILLIANT THANK YOU. Worked first time!
I was hoping to eventually rename files based on the values displayed in lookup columns. But I've had lots of trouble with Lookup Columns in the past so thought this might just be the first step but WOW this Flow did it for me. The Values presented themselves as options and IT JUST WORKED.

My only issue is the file Extension. I want it independent of file type I don't want every file to have a .docx extension!. My solution was to append the Dynamic Content "File name with extension" to my new file name. So I'm appending to the existing file name. And that's fine. Then ...

Scrolling through the comments I see instructions to use Split to get just the extension of the existing file stripping out the old file name. I used compose to get the extension BRILLIANT. Now I'm thinking I want the option "Append to front of existing file OR replace". BUT I'm not even sure I want to yet. I can always do two flows, that would be much easier.

Many, many, and lots more thanks John

AndrewParkinson
Автор

This is an excellent presentation, concise but thorough enough that a novice like me can follow along. I am relatively new to Power Automate and know nothing of XML or JSON, yet I was able to automate a task to rename several files we are migrating to Sharepoint. I placed this in an Apply to Each loop to rename all files in the library. The library contains mixed file types, so I will try using text manipulation on the current filename with extension to extract the extension portion and append it to the new filename.

jimhoeger
Автор

Sad to see you abandoned this channel! I've been struggling with this rename and although my use case was quite different because you taught us to figure stuff out I got it! If you have any suggestions of videos to watch to continue this learning path Please let me know!

bdesilva
Автор

Absolutely Brilliant. The best explanation available. Solved my problems. Love to fool proof method for obtaining the variable link contexts.

UCanDoItMike
Автор

You are amazing. Been looking for this specific info for a while and I love how you explain every detail. Amazing!

pzicwnh
Автор

Amazing video, thank you so much! Happy to see in a video which other things we can do through an HTTP request...cheers :)

andrescastrozaldua
Автор

This is a great video @John Day Q&A, thank you for sharing. Would love to see more on this very topic and the PowerAutomate SharePoint HTTP action.

karlstenator
Автор

Thanks, really well explained. Super helpful!

Ali-dkrr
Автор

Great video John, nicely explained and very helpful. Cheers!

ellyagold