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

Table.Keys

Owen Duncan|Last Updated: 4/19/2018

About

Returns a list of key column names from a table.

Table.Keys(table as table) as list  

Arguments

ArgumentDescription
tableTable to return a list of key column names from.

Example

let  

    table = Table.FromRecords(  

    {  

        [CustomerID = 1, Name = "Bob", Phone = "123-4567"],  

        [CustomerID = 2, Name = "Jim", Phone = "987-6543"]  

}),  

    resultTable = Table.AddKey(table, {"CustomerID"}, true),  

    keys = Table.Keys(resultTable),  

    #"Table from List" = Table.FromList(keys, Splitter.SplitByNothing(), null, null, ExtraValues.Error),  

    #"Expand Column1" = Table.ExpandRecordColumn(#"Table from List", "Column1", {"Columns", "Primary"}, {"Column1.Columns", "Column1.Primary"}),  

    #"Expand Column1.Columns" = Table.ExpandListColumn(#"Expand Column1", "Column1.Columns")  

in  

    #"Expand Column1.Columns"  
Column1.ColumnsColumn1.Primary
CustomerID1
© 2018 Microsoft