Power Automate: Workaround for using LinkFileName in Filter Query

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 existing 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.

Graphical user interface, text, application, email

Description automatically generated

Resolution

After a bit of research, I was able to find that we still have an option to use another filterable field that holds 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.

Graphical user interface, text, application, email

Description automatically generated

We did a search using the 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

Graphical user interface, application

Description automatically generated

Summary

Thus, we saw how we can use the 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

Related Articles

Author

Author

Priyaranjan KS is a Modern Workplace Architect primarily focused on developing and architecting solutions around Office 365,Power Platform and Azure.He is also a Microsoft Most Valuable Professional(MVP) and a Microsoft Certified Trainer(MCT)

Latest Articles