Jaa


Table.InsertRows

Syntaksi

Table.InsertRows(table as table, offset as number, rows as list) as table

Tietoja

Palauttaa taulukon, jossa on riviluettelo, rows, joka on asetettu kohtaan annetussa sijainnissa table offset. Jokaisen lisättävän rivin sarakkeen on vastattava taulukon saraketyyppejä.

Esimerkki 1

Lisää rivi taulukkoon sijaintiin 1.

Käyttö

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"]}
)

Tuloste

Table.FromRecords({
    [CustomerID = 1, Name = "Bob", Phone = "123-4567"],
    [CustomerID = 3, Name = "Paul", Phone = "543-7890"],
    [CustomerID = 2, Name = "Jim", Phone = "987-6543"]
})

Esimerkki 2

Lisää kaksi riviä taulukkoon sijaintiin 1.

Käyttö

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"]
    }
)

Tuloste

Table.FromRecords({
    [CustomerID = 1, Name = "Bob", Phone = "123-4567"],
    [CustomerID = 2, Name = "Jim", Phone = "987-6543"],
    [CustomerID = 3, Name = "Paul", Phone = "543-7890"]
})