Partager via


Table.ReplaceKeys

Syntaxe

Table.ReplaceKeys(table as table, keys as list) as table

À propos de

Remplace les clés de la table spécifiée.

Exemple 1

Remplacer les clés existantes d’une table.

Utilisation

let
    table = Table.FromRecords({
        [Id = 1, Name = "Hello There"],
        [Id = 2, Name = "Good Bye"]
    }),
    tableWithKeys = Table.AddKey(table, {"Id"}, true),
    resultTable = Table.ReplaceKeys(tableWithKeys, {[Columns = {"Id"}, Primary = false]})
in
    resultTable

Sortie

Table.FromRecords({
    [Id = 1, Name = "Hello There"],
    [Id = 2, Name = "Good Bye"]
})