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

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

Try this

Cheers