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

Table.RenameColumns

Owen Duncan|Last Updated: 10/5/2018
|
1 Contributor

About

Returns a table with the columns renamed as specified.

Table.RenameColumns(table as table, renames as list, optional missingField as nullable number) as table  

Arguments

ArgumentDescription
tableThe Table to modify.
renamesThe list of values to rename to.
optional missingFieldThe default value of missingField is MissingField.Error. For more information, see Parameter Values.

Remarks

  • Table.RenameColumns is similar to Record.RenameFields applied to every row in a table.

Examples

Table.RenameColumns(Table.FromRecords({  
  
    [CustomerNum=1, Name="Bob", Phone = "123-4567"]}),  
  
    {"CustomerNum", "CustomerID"})  
CustomerIDNamePhone
1Bob123-4567
Table.RenameColumns(Table.FromRecords({  
  
    [CustomerID=1, Name="Bob", Phone = "123-4567"]}), {"NewCol", "NewColumn"}, MissingField.UseNull)  
CustomerIDNamePhoneNewColumn
1Bob123-4567null
© 2018 Microsoft