Forum Discussion
Chris215
Aug 26, 2020Copper Contributor
KQL syntax to query for all documents, files and list items in auto applied retention label
Hello, I'm trying to come up with the best filter for auto retention to be set with. What will be the best way to auto apply retention on a SharePoint site to not include non end user working dat...
simesy
Apr 19, 2022Copper Contributor
I had the same problem. I have solved it with (FileType:docx OR FileType:pptx OR ...) and also just targeting a folder (site:"https://mytenant.sharepoint.com/sites/sitecollection/subsite/Some%20Templates") is a handy solution in some cases.
Tip for anyone googling this. When using PNP search web parts, and you want a Refiner setting, you need to use https://docs.microsoft.com/en-au/sharepoint/dev/general-development/fast-query-language-fql-syntax-reference.
and(FileType:or("docx","xlsx","pptx"),site:equals("https://mytenant.sharepoint.com/sites/sitecollection/subsite/Some%20Templates"))