Returns a record from a table containing field names and corresponding values | แปลงตารางที่มีชื่อฟิลด์และค่าเป็น Record
=Record.FromTable(table as table) as record
=Record.FromTable(table as table) as record
| Argument | Type | Required | Default | Description |
|---|---|---|---|---|
| table | table | Yes | A table containing records with Name and Value columns where each row’s Name becomes a field name and Value becomes the field value |
let Source = Table.FromRecords({ [Name = "CustomerID", Value = 1], [Name = "Name", Value = "Bob"], [Name = "Phone", Value = "123-4567"] }), Result = Record.From…let
Source = Table.FromRecords({
[Name = "CustomerID", Value = 1],
[Name = "Name", Value = "Bob"],
[Name = "Phone", Value = "123-4567"]
}),
Result = Record.FromTable(Source)
in
Result
[CustomerID = 1, Name = "Bob", Phone = "123-4567"]
let Data = Table.FromRecords({ [Name = "FirstName", Value = "Alice"], [Name = "LastName", Value = "Smith"], [Name = "Email", Value = "alice@example.com"] }), Re…let
Data = Table.FromRecords({
[Name = "FirstName", Value = "Alice"],
[Name = "LastName", Value = "Smith"],
[Name = "Email", Value = "alice@example.com"]
}),
Result = Record.FromTable(Data)
in
Result
[FirstName = "Alice", LastName = "Smith", Email = "alice@example.com"]
let Source = Table.FromRecords({[Name = "Jan", Value = 100], [Name = "Feb", Value = 150], [Name = "Mar", Value = 120]}), Record = Record.FromTable(Source) in Re…let
Source = Table.FromRecords({[Name = "Jan", Value = 100], [Name = "Feb", Value = 150], [Name = "Mar", Value = 120]}),
Record = Record.FromTable(Source)
in
Record
[Jan = 100, Feb = 150, Mar = 120]
Record.FromTable converts a structured table into a single record in Power Query. The table must contain Name and Value columns that define field names and their corresponding values.
ฟังก์ชัน Record.FromTable ใช้สำหรับแปลงตารางที่มีโครงสร้างเป็น Record เดียว โดยตารางต้องมีคอลัมน์ Name และ Value ที่กำหนดชื่อฟิลด์และค่าที่สอดคล้องกัน เหมาะสำหรับการแปลงข้อมูลจากรูปแบบตารางเป็นโครงสร้าง Record