Thep Excel

Record.RemoveFieldsRemove fields from a record

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

fx
=Record.RemoveFields(record, fields, [missingField]) as record

ความนิยม5/10
ความยาก3/10
ประโยชน์5/10

อัปเดต 3 December 2025

Syntax & Arguments

อาร์กิวเมนต์ ชนิด ค่าเริ่มต้น คำอธิบาย
record record The input record to modify
fields any Field name(s) to remove – either a single text value or a list of field names
[missingField]ไม่บังคับ nullable number null Optional parameter for handling missing fields

[ ] = อาร์กิวเมนต์ที่ไม่บังคับ

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

Examples

Remove a single fieldRecord.RemoveFields([CustomerID = 1, Item = "Fishing rod", Price = 18.00], "Price")

Removes the Price field from the record, keeping CustomerID and Item

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

ผลลัพธ์[CustomerID = 1, Item = "Fishing rod"]
Remove multiple fields at onceRecord.RemoveFields([CustomerID = 1, Item = "Fishing rod", Price = 18.00], {"Price", "Item"})

Removes both Price and Item fields, leaving only CustomerID

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

ผลลัพธ์[CustomerID = 1]
Use in a let-in expression for data cleanuplet 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

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

ผลลัพธ์[ID = 1, Name = "Alice"]

Resources & Related

ฟังก์ชันที่ผู้เขียนโยงไว้กับ Record.RemoveFields จัดกลุ่มตามหมวด · ชี้ที่ชื่อใดชื่อหนึ่ง แล้วฟังก์ชันที่ใช้คู่กันจะมีจุดทอง

ฟังก์ชันนี้Record.RemoveFieldsRecord functions
Record functions (6)
Record.AddField

Adds a new field with a specified name and value to a record | เพิ่มฟิลด์ใหม่พร้อมชื่อและค่าเข้าไปใน Record

Record.Field

Record.Field ดึงค่าของฟิลด์ที่ระบุจากบันทึก (record) โดยใช้ชื่อฟิลด์เป็นข้อความ ต่างจาก Record.FieldOrDefault ตรงที่จะเกิดข้อผิดพลาดหากฟิลด์ไม่พบ

Record.RenameFields

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

Record.ReorderFields

Rearranges the order of fields in a record | จัดเรียงลำดับฟิลด์ใหม่ใน Record ตามที่ต้องการ

Record.SelectFields

Record.SelectFields จะคืนค่า Record ใหม่ที่มีเฉพาะ Field ที่ระบุใน List เท่านั้น สามารถจัดการกับ Field ที่หายไปได้ด้วย option missingField

Record.TransformFields

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

Comments

อีเมลของคุณจะไม่ถูกเผยแพร่