Poznámka
Na prístup k tejto stránke sa vyžaduje oprávnenie. Môžete sa skúsiť prihlásiť alebo zmeniť adresáre.
Na prístup k tejto stránke sa vyžaduje oprávnenie. Môžete skúsiť zmeniť adresáre.
Syntax
Json.Document(jsonText as any, optional encoding as nullable number) as any
O
Vráti obsah dokumentu JSON.
-
jsonText: Obsah dokumentu JSON. Hodnotou tohto parametra môže byť text alebo binárna hodnota vrátená funkciou, akoFile.Contentsje . -
encoding: ,TextEncoding.Typektorá určuje kódovanie používané v dokumente JSON. Ak saencodingvynechá, použije sa UTF8.
Príklad č. 1
Vráti obsah zadaného textu JSON ako záznam.
používania
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
výstupu
[
project = "Contosoware",
description = "A comprehensive initiative aimed at enhancing digital presence."
components =
{
"Website Development",
"CRM Implementation",
"Mobile Application"
}
]
Príklad č. 2
Vráti obsah lokálneho súboru JSON.
používania
let
Source = Json.Document(
File.Contents("C:\test-examples\JSON\Contosoware.json")
)
in
Source
výstupu
A record, list, or primitive value representing the JSON data contained in the file
Príklad č. 3
Vráti obsah online súboru JSON s kódovaním UTF16.
používania
let
Source = Json.Document(
Web.Contents("htts://contoso.com/products/Contosoware.json"),
TextEncoding.Utf16)
)
in
Source
výstupu
A record, list, or primitive value representing the JSON UTF16 data contained in the file