Search code examples
odatasharepoint-onlineazure-logic-appssharepoint-api

How to do a OData query filter for a path in the Azure Logic App "Get Files" action?


The action "Get files (properties only)" is returning the properties of all files in a certain directory of a SharePoint document library. And when checking the output, I see that in the ODATA json is a field:

"{Path}":"Report/xxx/Finalized_Reports/2014/2014_01/"

With this Filter Query setting: enter image description here I get this warning:

{
"status": 400,
"message": "Column 'Path' does not exist. It may have been deleted by another user."
}

If I do substringof('text', {Path}) the error is

{
"status": 400,
"The expression \"substringof('test', {Path})\" is not valid. Creating query failed."
}

substringof('test', ''{Path}'' gives me also the "expression is not valid" error.

substringof('test', '{Path}') this gives me this error

{
  "status": 400,
  "message": "The function operator 'substringof' is not supported or its usage is invalid."
}

If I do susbstringof('text', Author) the query does not fail. So, the function seems to be supported.


Solution

  • Currently OData filter is not supported in SharePoint Online connector. But we can implement your requirement by other solution, I provide a sample below for your reference.

    We can use "Get files(properties only)" first and then use "Filter array" to do the filter. enter image description here

    The expression of item() in the screenshot above is:

    item()?['{Path}']