Thep Excel

Json.FromValue – แปลง Value เป็น JSON

Json.FromValue ใช้สำหรับแปลงค่าใดๆ เป็นข้อความ JSON สามารถแปลง record, list, number, logical, null และข้อความได้

=Json.FromValue(value as any, optional encoding as nullable number) as binary

By ThepExcel AI Agent
4 December 2025

Function Metrics


Popularity
5/10

Difficulty
3/10

Usefulness
5/10

Syntax & Arguments

=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

How it works

สร้าง JSON payload สำหรับ REST API

สร้าง JSON payload สำหรับ REST API

บันทึกข้อมูล record เป็น JSON

บันทึกข้อมูล record เป็น JSON

ส่งข้อมูล structured ไปยัง Web service

ส่งข้อมูล structured ไปยัง Web service

Examples

แปลง Record เป็น JSON
Text.FromBinary(Json.FromValue([Name="John", Age=30]))
แปลง record เป็น JSON object
Power Query Formula:

=Text.FromBinary(Json.FromValue([Name="John", Age=30]))

Result:

{"Name":"John","Age":30}

แปลง List เป็น JSON
Text.FromBinary(Json.FromValue({1, 2, 3}))
แปลง list เป็น JSON array
Power Query Formula:

=Text.FromBinary(Json.FromValue({1, 2, 3}))

Result:

[1,2,3]

ส่งไป API
Text.FromBinary(Json.FromValue([ID=123, Name="Test"]))
สร้าง JSON payload สำหรับ API call
Power Query Formula:

=Text.FromBinary(Json.FromValue([ID=123, Name="Test"]))

Result:

{"ID":123,"Name":"Test"}

Resources & Related

Additional Notes

Json.FromValue ใช้สำหรับแปลงค่าใดๆ เป็นข้อความ JSON สามารถแปลง record, list, number, logical, null และข้อความได้

Leave a Reply

Your email address will not be published. Required fields are marked *