I want to automatically remove any expiration date associated with Teams videos stored in a Sharepoint folder using Power Automate. In order to do this I have:
Created a listener for new files created in a Sharepoint folder - using "When file is created (properties only)".
This is where I am stuck - I am unable to find an action that allows me to update the expiration date. I have found:
I also looked at calling the Sharepoint API directly but wasn't able to find an example of an appropriate API call to make.
You can use a POST request with the SetExpirationDate method. Below is an example of that approach.
URI
_api/web/GetFileByServerRelativeUrl('/sites/YourSite/@{triggerOutputs()?['body/{FullPath}']}')/SetExpirationDate
Body Payload
{
"expirationDate":"2023-10-24T09:10:12.000Z"
}