---
title: Record.ToTable – แปลง Record เป็น Table
url: https://www.thepexcel.com/functions/power-query/record-functions/record-totable/
type: function-explainer
program: Power Query
syntax: Record.ToTable(record as record) as table
date: 2025-12-03
updated: 2025-12-17
scores:
  popularity: 5
  difficulty: 3
  usefulness: 5
---

# Record.ToTable – แปลง Record เป็น Table

> Convert a record to a table | แปลง Record เป็นตารางแบบ key-value pairs

## คำอธิบาย

Converts a record into a table with Name and Value columns | แปลง Record เป็นตารางที่มีคอลัมน์ Name และ Value สำหรับวิเคราะห์ข้อมูล

## Syntax

```excel
Record.ToTable(record as record) as table
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| record | Yes | record |  | Record |

## ตัวอย่าง

### 1. Convert a simple order record to a table

```excel
Record.ToTable([OrderID = 1, CustomerID = 1, Item = "Fishing rod", Price = 100.0])
```

**ผลลัพธ์:** `Table with 4 rows: {[Name="OrderID", Value=1], [Name="CustomerID", Value=1], [Name="Item", Value="Fishing rod"], [Name="Price", Value=100.0]}`

Converts record fields into a two-column table with Name and Value columns

### 2. Transform product information for analysis

```excel
let
    Product = [SKU = "ABC123", Category = "Electronics", InStock = true, Rating = 4.5],
    ProductTable = Record.ToTable(Product)
in
    ProductTable
```

**ผลลัพธ์:** `Table with 4 rows showing each attribute as a separate row with Name and Value`

Convert product metadata from record format into tabular format for further analysis

### 3. Pivot configuration settings to table

```excel
Record.ToTable([AppName = "Dashboard", Version = "2.1", Enabled = true, Timeout = 30])
```

**ผลลัพธ์:** `Table with 4 rows: [Name="AppName", Value="Dashboard"], [Name="Version", Value="2.1"], [Name="Enabled", Value=true], [Name="Timeout", Value=30]`

Transform application configuration from key-value pairs into a structured table format

## ฟังก์ชันที่เกี่ยวข้อง

- [Record.FromTable – Convert a table into a record](https://www.thepexcel.com/functions/power-query/record-functions/record-fromtable/)
- [Record.ToList – แปลง Record เป็น List ของค่าข้อมูล](https://www.thepexcel.com/functions/power-query/record-functions/record-tolist/)
- [Table.FromRecords – สร้างตารางจากรายการ Record](https://www.thepexcel.com/functions/power-query/table-functions/table-fromrecords/)

## แหล่งข้อมูลเพิ่มเติม

- [Microsoft Learn: Record.ToTable](https://learn.microsoft.com/en-us/powerquery-m/record-totable) _(official)_
- [PowerQuery.how](https://powerquery.how/record-totable/) _(guide)_

---

_Source: [https://www.thepexcel.com/functions/power-query/record-functions/record-totable/](https://www.thepexcel.com/functions/power-query/record-functions/record-totable/)_
