0

I'm trying to make sure a Sharepoint document structure is accurately mapped to a Azure Storage Container.

I am able to sync the sharepoint site when a file is created in sharepoint. However I have a challenge when a file is deleted in sharepoint.

The trigger I'm trying to use is "When a file is deleted", after which I want to get the file properties by passing the ID so that I can get the full path.

enter image description here

But the error on test says "File Not Found"

Now I'm guessing its because the file was actually deleted and hence there is no reference to it. But how can I trigger a flow on when a file is deleted, get the file full path and then use that to pass it to the Azure Storage container to delete the same file there?

smoizs
  • 341
  • 4
  • 13
  • Wow, what a pickle. How many files are we talking about here in relation to the entire library? Not files deleted, I mean files in total that exist. – Skin Apr 28 '23 at 01:27
  • @Skin about a 1000 files exist in sharepoint, which I'm syncing to Azure Storage container. Its easy to sync the files using the "when created or modified" trigger. Delete is the hard part, because the only thing delete returns is "ID" and "File name with extension" and ID is useless. – smoizs Apr 28 '23 at 12:38
  • @Skin one thing though, the file names are unique. So is there a way to search a blob container using the filename? then use that to get the ID of the blob and delete it? – smoizs Apr 28 '23 at 12:39
  • As far as I'm aware, filtering on the blobs works off a prefix so that would essentially mean that you'd need to know the full path which is your problem in the first place. If I were you, I'd build an Azure Function that did the work to filter on the file that you need so you can then delete it. Are you familiar with how to do that at all? – Skin May 01 '23 at 12:05

0 Answers0