Oharra
Baimena behar duzu orria atzitzeko. Direktorioetan saioa has dezakezu edo haiek alda ditzakezu.
Baimena behar duzu orria atzitzeko. Direktorioak alda ditzakezu.
Sintaxis
Json.Document(jsonText as any, optional encoding as nullable number) as any
Acerca de
Devuelve el contenido del documento JSON.
-
jsonText: el contenido del documento JSON. El valor de este parámetro puede ser texto o un valor binario devuelto por una función comoFile.Contents. -
encoding: UnTextEncoding.Typeque especifica la codificación utilizada en el documento JSON. Siencodingse omite, se usa UTF8.
Ejemplo 1
Devuelve el contenido del texto JSON especificado como un registro.
Uso
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
Salida
[
project = "Contosoware",
description = "A comprehensive initiative aimed at enhancing digital presence."
components =
{
"Website Development",
"CRM Implementation",
"Mobile Application"
}
]
Ejemplo 2
Devuelve el contenido de un archivo JSON local.
Uso
let
Source = Json.Document(
File.Contents("C:\test-examples\JSON\Contosoware.json")
)
in
Source
Salida
A record, list, or primitive value representing the JSON data contained in the file
Ejemplo 3
Devuelve el contenido de un archivo JSON con codificación UTF16 en línea.
Uso
let
Source = Json.Document(
Web.Contents("htts://contoso.com/products/Contosoware.json"),
TextEncoding.Utf16)
)
in
Source
Salida
A record, list, or primitive value representing the JSON UTF16 data contained in the file