Table.Keys

Returns the identifiers of the designated table.

Syntax

Table.Keys(table as table) as list

About

Returns the identifiers of the designated table.

Explanation

Retrieve the list of primary keys for a specific table in Power Query. To do this, use the M language with the following code: ```M let table = Table.FromRecords({ [Id = 1, Name = "Hello There"], [Id = 2, Name = "Good Bye"] }), tableWithKeys = Table.AddKey(table, {"Id"}, true), keys = Table.Keys(tableWithKeys) in keysOutput{[Columns = {"Id"}, Primary = true]} ```