I have a SharePoint Online site that contains several document libraries, some of which use a custom content type named, "Legal." And the Legal content type contains a metadata field named, "Purge Date." I need to produce a flow (using us.flow.microsoft.com) that updates deletes documents on their Purge Date, but only for those libraries that use the Legal content type. I have successfully used the "Get files (properties only)" action to get and interrogate files from a document library, but I have to hard-code the library name. I tried using the "Get all lists and libraries" action to iterate through the lists and libraries, then pass the library name to a "Get files (properties only)" action, but that has not worked for me.
My most recent attempt looks like this:
The Get all lists and libraries action looks like this:
I then use the Filter array action to filter the lists and libraries based on content type.
I then use an "Apply to each" action to find files whose Purge Date equals today's date (I have the date hard-coded, for now):
No files are being deleted, so I added logic the "If no" branch to update the document's Title field with a a debug statement, but don't know how to access the Title field:
Do you think I'm on the right path? Do you recommend a different approach? Thanks!