Table of contents
TOC
Collapse the table of content
Expand the table of content

Record.RenameFields

Owen Duncan|Last Updated: 4/19/2018

About

Returns a new record that renames the fields specified. The resultant fields will retain their original order. This function supports swapping and chaining field names. However, all target names plus remaining field names must constitute a unique set or an error will occur.

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

Arguments

ArgumentDescription
recordThe record to modify.
renamesThe list of renames to apply.
optional missingFieldA MissingField enum value to handle missing fields. The default value is MissingField.Error.

MissingField enum

  • MissingField.Error = 0;

  • MissingField.Ignore = 1;

  • MissingField.UseNull = 2;

Remarks

  • Record.RenameFields swaps and chains field names. If all target names plus remaining field names are not a unique set, an Expression.Error is thrown

Examples

Record.RenameFields([OrderID = 1, CustomerID = 1, Item = "Fishing rod", UnitPrice = 100.0], {"UnitPrice","Price"})  
equals [OrderID = 1, CustomerID = 1, Item = "Fishing rod", Price = 100.0]  
OrderID1
CustomerID1
ItemFishing rod
Price100
© 2018 Microsoft