Hello everyone,
I'm quite new to power automate and i'm having issue with a process i'm trying to implement.
I have a sharepoint folder where i want to convert all the words files i'm editing as pdf files automatically when modified. This process i managed to do quite easily following the differents tutorials found here an there and mixing up things to match my needs.
The issue i'm having is that i'm triggering my flow with a "When a file is created or modified (properties only)" trigger. Wich is perfect for my needs BUT, when i rename a file, it's considered as a modification (or maybe creation if i understand well the functionning of sharepoint?) and it creates a new PDF file with the new file name. This is all fine for me up to the point that the previous pdf files related to the previous named word documents are not deleted and are "duplicates". So i want to be able to delete when this happens.
My idea was to detect when the file is being "renamed" and not just modified in the Sharepoint but it seems the way Sharepoint is working doesn't make this so easy.
I tried the "get changes for an item" but it doesn't detect the name change. Just the modified tag is True.
I tried "Send an HTTP request to SharePoint" to get current version and previous version of the file datas, and compare them to see if the name was changed but it seems when the name the file changes it's not traced in the versions.
Anyways let me know if you have any ideas, What could be the more practical way?
Hopefully i was clear enough to understand. Let me know if you want more details.
Thanks in advance for your help.
Maël.