Catatan
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba masuk atau mengubah direktori.
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba mengubah direktori.
Sintaksis
Json.Document(jsonText as any, optional encoding as nullable number) as any
Tentang
Mengembalikan konten dokumen JSON.
-
jsonText: Konten dokumen JSON. Nilai parameter ini dapat berupa teks atau nilai biner yang dikembalikan oleh fungsi sepertiFile.Contents. -
encoding: ATextEncoding.Typeyang menentukan pengodean yang digunakan dalam dokumen JSON. Jikaencodingdihilangkan, UTF8 digunakan.
Contoh 1
Mengembalikan konten teks JSON yang ditentukan sebagai rekaman.
Penggunaan
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
Hasil
[
project = "Contosoware",
description = "A comprehensive initiative aimed at enhancing digital presence."
components =
{
"Website Development",
"CRM Implementation",
"Mobile Application"
}
]
Contoh 2
Mengembalikan konten file JSON lokal.
Penggunaan
let
Source = Json.Document(
File.Contents("C:\test-examples\JSON\Contosoware.json")
)
in
Source
Hasil
A record, list, or primitive value representing the JSON data contained in the file
Contoh 3
Mengembalikan konten file JSON yang dikodekan UTF16 online.
Penggunaan
let
Source = Json.Document(
Web.Contents("htts://contoso.com/products/Contosoware.json"),
TextEncoding.Utf16)
)
in
Source
Hasil
A record, list, or primitive value representing the JSON UTF16 data contained in the file