I’ve just built my first webhook which I’m using to make SharePoint Online take the changed files from one library and synchronise them across a set of libraries in the site collection’s subsites.
For adding of files, updating and deleting I’ve got it working fine but the one scenario I’m struggling to work with is renaming.
Because the webhook runs after the user changes the file name I’ve no way of then taking the name and updating the sub site copies. Instead SharePoint is treating the file as being new, copying it across and then leaving me with an orphaned file of the original.
Does anyone know if there is any other file property that could be used for cross reference on the other files? Like list internal names.
The only ways I can think to do this is through a look up on the version history, by storing the file name in another column and using that or by handling the renaming through a remote event receiver instead. The first two seem a bit hacky and would need extra coding just to handle those. Migrating to a RER just for this or having a RER just for renaming seems a fragmented solution as well.