Power Automate: Workaround for using LinkFileName in Filter Query

  • Introduction
  • Resolution
  • Summary

Introduction

While creating a Power Virtual agent that sends a search keyword as input to a Power Automate while invoking it, the flow was erroring out resulting in an error being shown back in PVA as:

To check the error, we jumped into the power automate and the error listed there was “The LinkFileName” of type computed cannot be used in the query filter expression.

So basically, we were using the Search Keyword input from the PVA chat window and using it as a filter query to see a document existed by that name in SharePoint using the Get Files action. However, the error thrown clearly states that we cannot use LinkFileName in the filter query as it’s a non-Filterable metadata field.

Resolution

After a bit of research, I was able to find that we still have an option to use another filterable field which hold the document name metadata which is FileRef .  So instead of LinkFileName we replaced it with FileRef in the filter query and the error went away.

We did a search using a keyword October and the PVA has transferred this input to the Power automate which has used the Get Files action to filter the specific file name using the revised filter query and we have the result shown back in the PVA chat window

Summary

Thus, we saw how we can use FileRef field instead of LinkFileName to filter the document library by the document file name and this comes in handy when you need to search for a specific document in the library