How to write a query for Filter by filename property in save email attachments activity

You were close but Try This

If(currentOffice365Message.Attachments.Any(Function(x) Path.GetExtension(x.Name).ToLower() = “.pdf”), “.pdf”, “.xls”)

If you find it as Solution then mark it as SOLUTION

Happy Automation