Table.AddKey
Syntax
Table.AddKey(table as table, columns as list, isPrimary as logical) as table
About
Adds a key to table
, where columns
is the list of column names that define the key, and isPrimary
specifies whether the key is primary.
Example 1
Add a single-column primary key to a table.
Usage
let
table = Table.FromRecords({
[Id = 1, Name = "Hello There"],
[Id = 2, Name = "Good Bye"]
}),
resultTable = Table.AddKey(table, {"Id"}, true)
in
resultTable
Output
Table.FromRecords({
[Id = 1, Name = "Hello There"],
[Id = 2, Name = "Good Bye"]
})
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for