Record.RemoveFields

This function retrieves a record that excludes all the fields listed in the specified list from the original record. An error is thrown if the specified field does not exist in the record.

Syntax

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

About

This function retrieves a record that excludes all the fields listed in the specified list from the original record. An error is thrown if the specified field does not exist in the record.

Explanation

Eliminate the "Price" field from the data record. Usage: Power Query MRecord.RemoveFields([CustomerID = 1, Item = "Fishing rod", Price = 18.00], "Price") Result: [CustomerID = 1, Item = "Fishing rod"] Remove both the "Price" and "Item" fields from the data record. Usage: Power Query MRecord.RemoveFields([CustomerID = 1, Item = "Fishing rod", Price = 18.00], {"Price", "Item"}) Result: [CustomerID = 1]