如何对Azure Logic App“获取文件”操作中的路径进行OData查询过滤?

问题描述

获取文件(仅属性)”操作将返回SharePoint文档库的特定目录中所有文件属性。在检查输出时,我看到ODATA json中是一个字段:

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

使用此过滤器查询设置:

enter image description here

我收到此警告:

substringof('text',{Path})

如果我做{ "status": 400,"The expression \"substringof('test',{Path})\" is not valid. Creating query Failed." } ,则错误

substringof('test',''{Path}''

substringof('test','{Path}')也给我“表达式无效”错误

{ "status": 400,"message": "The function operator 'substringof' is not supported or its usage is invalid." } 这给我这个错误

susbstringof('text',Author)

如果我执行aws events put-targets --rule "MyRule1" --targets "Id"="1","Arn"="arn:aws:ecs:us-east-1:123456789012:cluster/default","RoleArn"="arn:aws:iam::123456789012:role/ecsEventsRole","EcsParameters"="{"TaskDeFinitionArn"= "arn:aws:ecs:us-east-1:123456789012:task-deFinition/first-run-task-deFinition:1","TaskCount"= 1}","LaunchType"="FARGATE","NetworkConfiguration"="{"awsvpcConfiguration"="{"subnets"="subnet ID","SecurityGroups"="security group ID","AssignPublicIp"="ENABLED"}"}"}" 查询不会失败。因此,似乎支持功能

解决方法

当前,SharePoint Online连接器不支持OData筛选器。但是我们可以通过其他解决方案满足您的要求,下面提供一个示例供您参考。

我们可以先使用“ 获取文件(仅属性)”,然后使用“ Filter array”进行过滤。 enter image description here

上面的屏幕截图中的item()的表达式是:

item()?['{Path}']
,

对不起,我必须取消我对答案的决定。 同时,我找到了解决方案:可以传递的参数不是此操作的历史输出链接中看到的参数。您必须传递的参数是SharePoint文档库的internal field names

正确的过滤器查询是这样:

substringof('test',FileLeafRef)