Record.RemoveFields
RecordReturns a record with the specified fields removed.
Syntax
Record.RemoveFields(record as record, fields as any, optional missingField as nullable number) as recordParameters
| Name | Type | Required | Description |
|---|---|---|---|
record | record | Yes | The record to remove fields from. |
fields | any | Yes | A field name or list of field names to remove. |
missingField | number | No | A MissingField enum value that controls behavior when a specified field does not exist. Options are MissingField.Error (default), MissingField.Ignore, or MissingField.UseNull. |
Return Value
record — A record without the specified fields.
Remarks
Record.RemoveFields returns a new record with the specified fields excluded. This is the record-level equivalent of Table.RemoveColumns. Use the optional missingField parameter to control what happens when a field you try to remove does not exist — by default an error is raised, but you can choose to ignore missing fields with MissingField.Ignore.
Examples
Example 1: Remove OrderDate and Region from a Sales row
let
Trimmed = Record.RemoveFields(Sales{0}, {"OrderDate", "Region"})
in
Record.ToTable(Trimmed)Result
Name | Value | |
|---|---|---|
| 1 | OrderID | 1 |
| 2 | CustomerName | Alice |
| 3 | Product | Widget A |
| 4 | Category | Widgets |
| 5 | UnitPrice | 25 |
| 6 | Quantity | 4 |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks