Table.InsertRows
Syntaks
Table.InsertRows(table as table, offset as number, rows as list) as table
Omtrent
Returnerer en tabel med listen over rækker, rows
, indsat i table
på den angivne placering, offset
. Hver kolonne i rækken, der skal indsættes, skal svare til kolonnetyperne i tabellen.
Eksempel 1
Indsæt rækken i tabellen ved position 1.
brug
Table.InsertRows(
Table.FromRecords({
[CustomerID = 1, Name = "Bob", Phone = "123-4567"],
[CustomerID = 2, Name = "Jim", Phone = "987-6543"]
}),
1,
{[CustomerID = 3, Name = "Paul", Phone = "543-7890"]}
)
output
Table.FromRecords({
[CustomerID = 1, Name = "Bob", Phone = "123-4567"],
[CustomerID = 3, Name = "Paul", Phone = "543-7890"],
[CustomerID = 2, Name = "Jim", Phone = "987-6543"]
})
Eksempel 2
Indsæt to rækker i tabellen ved position 1.
brug
Table.InsertRows(
Table.FromRecords({[CustomerID = 1, Name = "Bob", Phone = "123-4567"]}),
1,
{
[CustomerID = 2, Name = "Jim", Phone = "987-6543"],
[CustomerID = 3, Name = "Paul", Phone = "543-7890"]
}
)
output
Table.FromRecords({
[CustomerID = 1, Name = "Bob", Phone = "123-4567"],
[CustomerID = 2, Name = "Jim", Phone = "987-6543"],
[CustomerID = 3, Name = "Paul", Phone = "543-7890"]
})