แปลง Record เป็น JSON
=Text.FromBinary(Json.FromValue([Name="John", Age=30]))
{"Name":"John","Age":30}
แปลงค่าเป็นข้อความ JSON
Json.FromValue ใช้สำหรับแปลงค่าใดๆ เป็นข้อความ JSON สามารถแปลง record, list, number, logical, null และข้อความได้
=Json.FromValue(value as any, optional encoding as nullable number) as binary
=Json.FromValue(value as any, optional encoding as nullable number) as binary
| Argument | Type | Required | Default | Description |
|---|---|---|---|---|
| value | any | Yes | ค่าที่ต้องการแปลงเป็น JSON | |
| encoding | nullable number | Optional | UTF8 | ประเภทการเข้ารหัสของ JSON output |
สร้าง JSON payload สำหรับ REST API
บันทึกข้อมูล record เป็น JSON
ส่งข้อมูล structured ไปยัง Web service
=Text.FromBinary(Json.FromValue([Name="John", Age=30]))
{"Name":"John","Age":30}
=Text.FromBinary(Json.FromValue({1, 2, 3}))
[1,2,3]
=Text.FromBinary(Json.FromValue([ID=123, Name="Test"]))
{"ID":123,"Name":"Test"}
Json.FromValue ใช้สำหรับแปลงค่าใดๆ เป็นข้อความ JSON สามารถแปลง record, list, number, logical, null และข้อความได้