---
title: Record.RenameFields – Rename fields in a record
url: https://www.thepexcel.com/functions/power-query/record-functions/record-renamefields/
type: function-explainer
program: Power Query
syntax: "Record.RenameFields(record as record, renames as list, optional missingField as nullable number) as record"
date: 2025-12-03
updated: 2025-12-17
scores:
  popularity: 5
  difficulty: 3
  usefulness: 5
---

# Record.RenameFields – Rename fields in a record

> Rename one or more fields in a record | เปลี่ยนชื่อฟิลด์หนึ่งหรือหลายฟิลด์ใน Record

## คำอธิบาย

Returns a record after renaming specified fields | เปลี่ยนชื่อฟิลด์ที่ระบุใน Record

## Syntax

```excel
Record.RenameFields(record as record, renames as list, optional missingField as nullable number) as record
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| record | Yes | record |  | The input record to modify |
| renames | Yes | list |  | List of rename pairs where each pair is {OldName, NewName}. For a single rename use {{"OldName", "NewName"}}, for multiple use {{{"Old1", "New1"}, {"Old2", "New2"}}} |
| missingField | No | nullable number | null | Optional parameter for handling missing fields |

## ตัวอย่าง

### 1. Rename a single field

```excel
Record.RenameFields([OrderID = 1, CustomerID = 1, Item = "Fishing rod", UnitPrice = 100.0], {{"UnitPrice", "Price"}})
```

**ผลลัพธ์:** `[OrderID = 1, CustomerID = 1, Item = "Fishing rod", Price = 100.0]`

Renames the UnitPrice field to Price while keeping all other fields unchanged

### 2. Rename multiple fields at once

```excel
Record.RenameFields([OrderNum = 1, CustomerID = 1, Item = "Fishing rod", UnitPrice = 100.0], {{{"UnitPrice", "Price"}, {"OrderNum", "OrderID"}}})
```

**ผลลัพธ์:** `[OrderID = 1, CustomerID = 1, Item = "Fishing rod", Price = 100.0]`

Performs multiple renames simultaneously: OrderNum becomes OrderID and UnitPrice becomes Price

### 3. Standardize field names from data source

```excel
let
    RawData = [Col1 = "John", Col2 = 30, Col3 = "USA"],
    StandardField = Record.RenameFields(RawData, {{{"Col1", "FirstName"}, {"Col2", "Age"}, {"Col3", "Country"}}})
in
    StandardField
```

**ผลลัพธ์:** `[FirstName = "John", Age = 30, Country = "USA"]`

Convert generic column names from a data source into meaningful business-friendly field names

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

- [Record.SelectFields – เลือก Field ที่ต้องการจาก Record](https://www.thepexcel.com/functions/power-query/record-functions/record-selectfields/)
- [Record.RemoveFields – Remove fields from a record](https://www.thepexcel.com/functions/power-query/record-functions/record-removefields/)
- [Table.RenameColumns – เปลี่ยนชื่อคอลัมน์ในตาราง](https://www.thepexcel.com/functions/power-query/table-functions/table-renamecolumns/)

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

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

---

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