통사론
SharePoint.Files(url as text, optional options as nullable record) as table
정보
하위 폴더의 파일을 포함하여 지정된 SharePoint 사이트에서 url찾은 각 파일에 대해 하나의 행이 포함된 테이블을 반환합니다. 이와 달리 SharePoint.Contents이 함수는 플랫 테이블을 반환하며 폴더에 대한 행을 포함하지 않습니다. 사이트 URL은 쿼리 문자열 또는 조각을 포함할 수 없습니다. 각 행에는 열에 파일의 이진 콘텐츠 Content 와 , , Date accessedExtension, Date createdDate modifiedAttributes및 Folder Path 열의 Name파일 메타데이터가 포함됩니다. 값은 Folder Path 파일이 포함된 폴더의 절대 URL입니다.
options 다음 옵션을 제어하도록 지정할 수 있습니다.
-
ApiVersion: 이 사이트에 사용할 SharePoint API 버전을 지정하는 숫자(14 또는 15) 또는 텍스트 "자동"입니다. 지정하지 않으면 API 버전 14가 사용됩니다. 자동을 지정하면 가능하면 서버 버전이 자동으로 검색되고, 그렇지 않으면 버전이 기본값인 14로 설정됩니다. 영어가 아닌 SharePoint 사이트에는 버전 15 이상이 필요합니다.
예제 1
자동 API 선택을 사용하여 Contoso SharePoint 사이트의 모든 파일에 대한 이름, 파일 확장명 및 폴더 URL을 나열합니다.
Usage
let
Source = SharePoint.Files(
"https://contoso.sharepoint.com/sites/Contoso",
[ApiVersion = "Auto"]
),
SelectedColumns = Table.SelectColumns(
Source,
{"Name", "Extension", "Folder Path"}
)
in
SelectedColumns
Output
A table containing the name, extension, and absolute folder URL for each file in the site and its subfolders.
예제 2
Contoso SharePoint 사이트에서 확장명 있는 모든 파일을 .xlsx 반환합니다. 이 예제에서는 영어 및 영어 이외의 SharePoint 사이트에서 작동하는 API 버전 15를 사용합니다. 확장 비교는 대/소문자를 구분하지 않으므로 일치 .XLSX합니다.
Usage
let
Source = SharePoint.Files(
"https://contoso.sharepoint.com/sites/Contoso",
[ApiVersion = 15]
),
ExcelWorkbooks = Table.SelectRows(
Source,
each Comparer.OrdinalIgnoreCase([Extension], ".xlsx") = 0
)
in
ExcelWorkbooks
Output
A table containing every .xlsx file in the site and its subfolders.
예제 3
폴더에 직접 저장된 파일만 반환합니다 Shared Documents/Reports . 정확한 Folder Path 일치 항목은 하위 폴더의 파일을 제외합니다.
Usage
let
Source = SharePoint.Files("https://contoso.sharepoint.com/sites/Contoso"),
ReportsFiles = Table.SelectRows(
Source,
each [Folder Path] = "https://contoso.sharepoint.com/sites/Contoso/Shared Documents/Reports/"
)
in
ReportsFiles
Output
A table containing only the files stored directly in the Reports folder.
예제 4
공유 문서/보고서 폴더에서 Budget.xlsx 이진 콘텐츠를 반환합니다.
Usage
let
Source = SharePoint.Files("https://contoso.sharepoint.com/sites/Contoso"),
Budget = Source{
[
Name = "Budget.xlsx",
#"Folder Path" = "https://contoso.sharepoint.com/sites/Contoso/Shared Documents/Reports/"
]
}[Content]
in
Budget
Output
The binary content of Budget.xlsx.