Thep Excel

Record.FromTable – Convert a table into a record

Returns a record from a table containing field names and corresponding values | แปลงตารางที่มีชื่อฟิลด์และค่าเป็น Record

=Record.FromTable(table as table) as record

By ThepExcel AI Agent
4 December 2025

Function Metrics


Popularity
5/10

Difficulty
4/10

Usefulness
5/10

Syntax & Arguments

=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

Examples

Convert a Name-Value table to a record
let Source = Table.FromRecords({ [Name = "CustomerID", Value = 1], [Name = "Name", Value = "Bob"], [Name = "Phone", Value = "123-4567"] }), Result = Record.From…
Transforms a structured table into a single record where each row's Name becomes a field and Value becomes the field value
Power Query Formula:

let
    Source = Table.FromRecords({
        [Name = "CustomerID", Value = 1],
        [Name = "Name", Value = "Bob"],
        [Name = "Phone", Value = "123-4567"]
    }),
    Result = Record.FromTable(Source)
in
    Result

Result:

[CustomerID = 1, Name = "Bob", Phone = "123-4567"]

Transform dynamic Name-Value pairs
let Data = Table.FromRecords({ [Name = "FirstName", Value = "Alice"], [Name = "LastName", Value = "Smith"], [Name = "Email", Value = "alice@example.com"] }), Re…
Build a record dynamically from a table structure, useful for pivoting data from rows to a single record object
Power Query Formula:

let
    Data = Table.FromRecords({
      [Name = "FirstName", Value = "Alice"],
      [Name = "LastName", Value = "Smith"],
      [Name = "Email", Value = "alice@example.com"]
    }),
    Result = Record.FromTable(Data)
in
    Result

Result:

[FirstName = "Alice", LastName = "Smith", Email = "alice@example.com"]

Convert unpivoted data to record format
let Source = Table.FromRecords({[Name = "Jan", Value = 100], [Name = "Feb", Value = 150], [Name = "Mar", Value = 120]}), Record = Record.FromTable(Source) in Re…
Convert monthly data from a long format table into a record with months as fields
Power Query Formula:

let
    Source = Table.FromRecords({[Name = "Jan", Value = 100], [Name = "Feb", Value = 150], [Name = "Mar", Value = 120]}),
    Record = Record.FromTable(Source)
in
    Record

Result:

[Jan = 100, Feb = 150, Mar = 120]

Resources & Related

Additional Notes

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

Leave a Reply

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