다음을 통해 공유


Json.Document

통사론

Json.Document(jsonText as any, optional encoding as nullable number) as any

소개

JSON 문서의 내용을 반환합니다.

  • jsonText: JSON 문서의 내용입니다. 이 매개 변수의 값은 File.Content와 같은 함수에서 반환하는 텍스트 또는 이진 값일 수 있습니다.
  • encoding TextEncoding.Type: JSON 문서에 사용되는 인코딩을 지정하는 A입니다. encoding 생략하면 UTF8이 사용됩니다.

예제 1

지정된 JSON 텍스트의 내용을 레코드로 반환합니다.

사용법

let
    Source = "{
        ""project"": ""Contosoware"",
        ""description"": ""A comprehensive initiative aimed at enhancing digital presence."",
        ""components"": [
            ""Website Development"",
            ""CRM Implementation"",
            ""Mobile Application""
        ]
    }",
    jsonDocument = Json.Document(Source)
in
    jsonDocument

출력

[
    project = "Contosoware",
    description = "A comprehensive initiative aimed at enhancing digital presence."
    components =
    {
        "Website Development",
        "CRM Implementation",
        "Mobile Application"
    }
]

예제 2

로컬 JSON 파일의 콘텐츠를 반환합니다.

사용법

let
    Source = (Json.Document(
        File.Contents("C:\test-examples\JSON\Contosoware.json")
    )
in
    Source

출력

파일에 포함된 JSON 데이터를 나타내는 레코드, 목록 또는 기본값

예제 3

온라인 UTF16으로 인코딩된 JSON 파일의 콘텐츠를 반환합니다.

사용법

let
    Source = Json.Document(
        Web.Contents("htts://contoso.com/products/Contosoware.json"),
        TextEncoding.Utf16)
    )

출력

파일에 포함된 JSON UTF16 데이터를 나타내는 레코드, 목록 또는 기본값