对数组进行筛选后从 Sharepoint 获取文件
Get files from Sharepoint after doing a Filter on Array
我遇到的问题是:
Sharepoint Get File Files (Properties Only) 只能为 ODATA 做一个过滤器,而不是第二个 AND 子句,所以我需要使用 Filter Array 来使二级过滤器工作。它确实有效....
但现在我需要获取过滤后的数组并以某种方式获取 {FullPath} 属性 并通过传递路径获取文件内容,但出现此错误...
[ {
"@odata.etag": ""1"",
"ItemInternalId": "120",
"ID": 120,
"Modified": "2022-03-21T15:03:31Z",
"Editor": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|dev@email.com",
"DisplayName": "Bob dole",
"Email": "dev@email.com",
"Picture": "https://company.sharepoint.us/sites/devtest/_layouts/15/UserPhoto.aspx?Size=L&AccountName=dev@email.com",
"Department": "Information Technology",
"JobTitle": "Senior Applications Developer II"
},
"Editor#Claims": "data",
"Created": "2022-03-21T15:03:31Z",
"Author": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|dev@email.com",
"DisplayName": "Bob Dole",
"Email": "dev@email.com",
"Picture": "https://company.sharepoint.us/sites/devtest/_layouts/15/UserPhoto.aspx?Size=L&AccountName=dev@email.com",
"Department": "Information Technology",
"JobTitle": "Senior Applications Developer II"
},
"Author#Claims": "i:0#.f|membership|dev@email.com",
"OData__DisplayName": "",
"{Identifier}": "Shared%2bDocuments%252fSDS%252fFiles%252fA10_NICKEL%2bVANADIUM%2bPRODUCT_PIS-USA_French.pdf",
"{IsFolder}": false,
"{Thumbnail}": ...DATA,
"{Link}": "https://company.sharepoint.us/sites/devtest/Shared%20Documents/SDS/Files/A10_NICKEL%20VANADIUM%20PRODUCT_PIS-USA_French.pdf",
"{Name}": "A10_NICKEL VANADIUM PRODUCT_PIS-USA_French",
"{FilenameWithExtension}": "A10_NICKEL VANADIUM PRODUCT_PIS-USA_French.pdf",
"{Path}": "Shared Documents/SDS/Files/",
"{FullPath}": "Shared Documents/SDS/Files/A10_NICKEL VANADIUM PRODUCT_PIS-USA_French.pdf",
"{IsCheckedOut}": false,
"{VersionNumber}": "1.0" } ]
所以据我所见,我认为这就是我的想法。即使您将数组过滤为单个元素,您也需要像对待数组一样对待它。
我假设您在过滤步骤后总是会检索到单个项目。
我创建了一个变量 (SharePoint Documents
) 来存储您的“过滤”数组,这样我就可以提取 {FullPath}
属性.
然后我创建了用 first 初始化的变量(同样,我假设你的过滤器只会 return 一个元素)和使用了这个表达式...
variables('SharePoint Documents')?[0]['{FullPath}']
这是结果,您可以在下一步中使用它从 SharePoint 获取文件内容...
如果我的假设是错误的,并且您可以有多个,那么您需要将其放入一个循环中并做同样的事情...
这是...
中包含的表达式
items('For_Each_in_Array')['{FullPath}']
结果...
我实际上最终这样做了并且有效。
我遇到的问题是:
Sharepoint Get File Files (Properties Only) 只能为 ODATA 做一个过滤器,而不是第二个 AND 子句,所以我需要使用 Filter Array 来使二级过滤器工作。它确实有效....
但现在我需要获取过滤后的数组并以某种方式获取 {FullPath} 属性 并通过传递路径获取文件内容,但出现此错误...
[ { "@odata.etag": ""1"", "ItemInternalId": "120", "ID": 120, "Modified": "2022-03-21T15:03:31Z", "Editor": { "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", "Claims": "i:0#.f|membership|dev@email.com", "DisplayName": "Bob dole", "Email": "dev@email.com", "Picture": "https://company.sharepoint.us/sites/devtest/_layouts/15/UserPhoto.aspx?Size=L&AccountName=dev@email.com", "Department": "Information Technology", "JobTitle": "Senior Applications Developer II" }, "Editor#Claims": "data", "Created": "2022-03-21T15:03:31Z", "Author": { "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", "Claims": "i:0#.f|membership|dev@email.com", "DisplayName": "Bob Dole", "Email": "dev@email.com", "Picture": "https://company.sharepoint.us/sites/devtest/_layouts/15/UserPhoto.aspx?Size=L&AccountName=dev@email.com", "Department": "Information Technology", "JobTitle": "Senior Applications Developer II" }, "Author#Claims": "i:0#.f|membership|dev@email.com", "OData__DisplayName": "", "{Identifier}": "Shared%2bDocuments%252fSDS%252fFiles%252fA10_NICKEL%2bVANADIUM%2bPRODUCT_PIS-USA_French.pdf", "{IsFolder}": false, "{Thumbnail}": ...DATA, "{Link}": "https://company.sharepoint.us/sites/devtest/Shared%20Documents/SDS/Files/A10_NICKEL%20VANADIUM%20PRODUCT_PIS-USA_French.pdf", "{Name}": "A10_NICKEL VANADIUM PRODUCT_PIS-USA_French", "{FilenameWithExtension}": "A10_NICKEL VANADIUM PRODUCT_PIS-USA_French.pdf", "{Path}": "Shared Documents/SDS/Files/", "{FullPath}": "Shared Documents/SDS/Files/A10_NICKEL VANADIUM PRODUCT_PIS-USA_French.pdf", "{IsCheckedOut}": false, "{VersionNumber}": "1.0" } ]
所以据我所见,我认为这就是我的想法。即使您将数组过滤为单个元素,您也需要像对待数组一样对待它。
我假设您在过滤步骤后总是会检索到单个项目。
我创建了一个变量 (SharePoint Documents
) 来存储您的“过滤”数组,这样我就可以提取 {FullPath}
属性.
然后我创建了用 first 初始化的变量(同样,我假设你的过滤器只会 return 一个元素)和使用了这个表达式...
variables('SharePoint Documents')?[0]['{FullPath}']
这是结果,您可以在下一步中使用它从 SharePoint 获取文件内容...
如果我的假设是错误的,并且您可以有多个,那么您需要将其放入一个循环中并做同样的事情...
这是...
中包含的表达式items('For_Each_in_Array')['{FullPath}']
结果...
我实际上最终这样做了并且有效。