---
title: Record.ToList – แปลง Record เป็น List ของค่าข้อมูล
url: https://www.thepexcel.com/functions/power-query/record-functions/record-tolist/
type: function-explainer
program: Power Query
syntax: Record.ToList(record as record) as list
date: 2025-12-03
updated: 2025-12-17
scores:
  popularity: 4
  difficulty: 3
  usefulness: 4
---

# Record.ToList – แปลง Record เป็น List ของค่าข้อมูล

> แปลง Record เป็น List

## คำอธิบาย

แปลง Record เป็น List ของค่าข้อมูล

## Syntax

```excel
Record.ToList(record as record) as list
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| record | Yes | record |  | Record ที่ต้องการแปลง |

## เคสการใช้งาน

### เตรียมข้อมูลสำหรับคำนวณ

แปลงข้อมูลใน Record ให้เป็น List เพื่อใช้ฟังก์ชันกลุ่ม List (เช่น List.Sum, List.Average) คำนวณต่อ

### Flatten ข้อมูล

ดึงค่าทั้งหมดออกมาเป็นลำดับเพื่อนำไปใช้งานต่อ

## ตัวอย่าง

### 1. ตัวอย่างที่ 1: แปลง Record พื้นฐาน

```excel
Record.ToList([A=10, B=20])
```

**ผลลัพธ์:** `{10, 20}`

ได้ List ที่มีสมาชิกคือ 10 และ 20

### 2. ตัวอย่างที่ 2: Record ที่มีข้อมูลหลายประเภท

```excel
Record.ToList([Name="Bob", Age=30, IsMember=true])
```

**ผลลัพธ์:** `{"Bob", 30, true}`

ข้อมูลถูกดึงออกมาเป็น List ตามลำดับ Field

### 3. ตัวอย่างที่ 3: แปลง Record ว่าง

```excel
Record.ToList([])
```

**ผลลัพธ์:** `{}`

Record ว่างจะได้ List ว่าง

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

- [Record.FromList – สร้าง Record จาก List ของค่าและชื่อ Field](https://www.thepexcel.com/functions/power-query/record-functions/record-fromlist/)
- [Record.ToTable – แปลง Record เป็น Table](https://www.thepexcel.com/functions/power-query/record-functions/record-totable/)
- [Record.FieldValues – คืนค่าข้อมูลทั้งหมดใน Record เป็น List](https://www.thepexcel.com/functions/power-query/record-functions/record-fieldvalues/)
- [Record.FromTable – Convert a table into a record](https://www.thepexcel.com/functions/power-query/record-functions/record-fromtable/)

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

- [Microsoft Learn: Record.ToList](https://learn.microsoft.com/en-us/powerquery-m/record-tolist) _(Official Documentation)_
- [PowerQuery.how](https://powerquery.how/record-tolist/) _(guide)_

---

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