Thep Excel

Record.RemoveFields – Remove fields from a record

Removes specified fields from a record | ลบฟิลด์ที่ระบุออกจาก Record

=Record.RemoveFields(record as record, fields as any, optional missingField as nullable number) as record

By ThepExcel AI Agent
3 December 2025

Function Metrics


Popularity
5/10

Difficulty
3/10

Usefulness
5/10

Syntax & Arguments

=Record.RemoveFields(record as record, fields as any, optional missingField as nullable number) as record

Argument Type Required Default Description
record record Yes The input record to modify
fields any Yes Field name(s) to remove – either a single text value or a list of field names
missingField nullable number Optional null Optional parameter for handling missing fields

Examples

Remove a single field
Record.RemoveFields([CustomerID = 1, Item = "Fishing rod", Price = 18.00], "Price")
Removes the Price field from the record, keeping CustomerID and Item
Power Query Formula:

=Record.RemoveFields([CustomerID = 1, Item = "Fishing rod", Price = 18.00], "Price")

Result:

[CustomerID = 1, Item = "Fishing rod"]

Remove multiple fields at once
Record.RemoveFields([CustomerID = 1, Item = "Fishing rod", Price = 18.00], {"Price", "Item"})
Removes both Price and Item fields, leaving only CustomerID
Power Query Formula:

=Record.RemoveFields([CustomerID = 1, Item = "Fishing rod", Price = 18.00], {"Price", "Item"})

Result:

[CustomerID = 1]

Use in a let-in expression for data cleanup
let Customer = [ID = 1, Name = "Alice", TempID = "ABC", ProcessFlag = true], Cleaned = Record.RemoveFields(Customer, {"TempID", "ProcessFlag"}) in Cleaned
Remove temporary working fields before returning the final record
Power Query Formula:

let
    Customer = [ID = 1, Name = "Alice", TempID = "ABC", ProcessFlag = true],
    Cleaned = Record.RemoveFields(Customer, {"TempID", "ProcessFlag"})
in
    Cleaned

Result:

[ID = 1, Name = "Alice"]

Resources & Related

Additional Notes

Record.RemoveFields removes specified fields from a Power Query record. You can remove a single field by name or multiple fields by providing a list. If a field doesn’t exist, an exception is thrown unless handling is specified.

ฟังก์ชัน Record.RemoveFields ใช้สำหรับลบฟิลด์ที่ระบุออกจาก Record ใน Power Query สามารถลบฟิลด์เดียวหรือหลายฟิลด์พร้อมกันได้โดยส่งเป็นรายการ เหมาะสำหรับการทำความสะอาดข้อมูลหรือลบฟิลด์ที่ไม่ต้องการออกจาก Record

Leave a Reply

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