Table.InsertRows
Table.InsertRows(table as table, offset as number, rows as list) as table
返回一个表,其中行列表 rows
插入到 table
的给定位置 offset
。要插入的行中的每列都必须与表的列类型相符。
示例:
将行插入表中的位置 1。
使用情况:
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"]})
输出:
Table.FromRecords({[CustomerID=1,Name="Bob",Phone="123-4567"],[CustomerID=3,Name="Paul",Phone="543-7890"],[CustomerID=2,Name="Jim",Phone="987-6543"]})
示例:
将两行插入表中的位置 1。
使用情况:
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"] })
输出:
Table.FromRecords({[CustomerID=1,Name="Bob",Phone="123-4567"],[CustomerID=2,Name="Jim",Phone="987-6543"], [CustomerID=3,Name="Paul",Phone="543-7890"]})