OpenBI Docs Buy

List.InsertRange

A list with other items put in at a position.

Group: List. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

List.InsertRange(list as list, index as number, values as list) as list
ParameterTypeDescription
listlistThe list.
indexnumberWhere the new items go, counted from 0; the list's count puts them at the end.
valueslistThe items to insert.

Returns

list. The list with the new items in place.

Examples

Two products in the middle

List.InsertRange({"Coffee", "Milk"}, 1, {"Tea", "Juice"})
{"Coffee", "Tea", "Juice", "Milk"}

At the end

List.InsertRange({"Coffee", "Milk"}, 2, {"Water"})
{"Coffee", "Milk", "Water"}

List.RemoveRange, List.Combine, Table.InsertRows.

Last updated · OpenBI Studio 0.3.79