---
title: Record.Combine – รวมหลาย Record เป็นหนึ่งเดียว
url: https://www.thepexcel.com/functions/power-query/record-functions/record-combine/
type: function-explainer
program: Power Query
syntax: Record.Combine(records as list) as record
date: 2025-12-03
updated: 2025-12-17
scores:
  popularity: 5
  difficulty: 4
  usefulness: 5
---

# Record.Combine – รวมหลาย Record เป็นหนึ่งเดียว

> รวมหลาย Record เข้าด้วยกัน

## คำอธิบาย

รวม List ของ Record ให้เป็น Record เดียว

## Syntax

```excel
Record.Combine(records as list) as record
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| records | Yes | list |  | List ที่เก็บ Record ที่ต้องการนำมารวมกัน |

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

### รวมค่า Default กับค่าที่กำหนดเอง

ใช้รวม Record ของค่า Default เข้ากับ Record ของค่าที่ User กรอกมา โดยให้ค่าของ User ทับค่า Default หากมีการระบุมา

### Merge ข้อมูล

รวมข้อมูลจากหลายแหล่งที่อยู่ในรูปแบบ Record เข้าด้วยกัน

## ตัวอย่าง

### 1. ตัวอย่างที่ 1: รวม Record ที่ Field ไม่ซ้ำกัน

```excel
Record.Combine({[ID = 1], [Name = "Bob"]})
```

**ผลลัพธ์:** `[ID=1, Name="Bob"]`

รวม 2 Record เข้าด้วยกันเป็น Record เดียวที่มีทั้ง Field ID และ Name

### 2. ตัวอย่างที่ 2: รวม Record ที่มี Field ซ้ำกัน (Overwrite)

```excel
Record.Combine({[A=1, B=2], [A=10]})
```

**ผลลัพธ์:** `[A=10, B=2]`

Field "A" มีในทั้ง 2 Record ค่าจาก Record หลังสุด (10) จะทับค่าเดิม (1)

### 3. ตัวอย่างที่ 3: รวม List ว่าง

```excel
Record.Combine({})
```

**ผลลัพธ์:** `[]`

หาก List ว่าง จะได้ผลลัพธ์เป็น Empty Record

## คำถามที่พบบ่อย

**Q: ถ้า Field ซ้ำกัน จะเกิดอะไรขึ้น?**

ค่าจาก Record ที่อยู่ลำดับหลังใน List จะถูกนำมาใช้ (Overwrite ค่าก่อนหน้า)

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

- [List.Combine – รวม List](https://www.thepexcel.com/functions/power-query/list-functions/list-combine/)
- [Table.Combine – รวมหลาย table เข้าด้วยกัน](https://www.thepexcel.com/functions/power-query/table-functions/table-combine/)

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

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

---

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