構文
Json.Document(jsonText as any, optional encoding as nullable number) as any
バージョン情報
JSON ドキュメントの内容を返します。
-
jsonText: JSON ドキュメントの内容。 このパラメーターの値には、テキストや、File.Contentsなどの関数によって返されるバイナリ値を指定できます。 -
encoding: JSON ドキュメントで使用されるエンコードを指定するTextEncoding.Type。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
アウトプット
A record, list, or primitive value representing the JSON data contained in the file
例 3
オンライン UTF16 でエンコードされた JSON ファイルの内容を返します。
使用方法
let
Source = Json.Document(
Web.Contents("htts://contoso.com/products/Contosoware.json"),
TextEncoding.Utf16)
)
in
Source
アウトプット
A record, list, or primitive value representing the JSON UTF16 data contained in the file