Table.ToList

Table

Converts a table to a list by applying a combiner function to each row.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Table.ToList(table as table, optional combiner as nullable function) as list

Parameters

NameTypeRequiredDescription
tabletableYesThe table to convert.
combinerfunctionNoA function that takes a list of row values and returns a single value. Defaults to Combiner.CombineTextByDelimiter(",").

Return Value

listA list with one element per row, produced by applying the combiner to each row's values.

Remarks

Table.ToList converts each row of a table into a single value using the supplied combiner function. The default combiner joins row values into a comma-separated text string.

Supply a custom combiner to produce any desired output type — for example, to collect row records or concatenate with a different separator.

Examples

Example 1: Convert a single-column table to a list

let
    Source = #table({"Value"}, {{1}, {2}, {3}}),
    Result = Table.ToList(Source, each _{0})
in
    Result
Result
Result
11
22
33

Example 2: Join row values into delimited text

let
    Source = #table({"A","B"}, {{"x","y"},{"p","q"}}),
    Result = Table.ToList(Source, Combiner.CombineTextByDelimiter("|"))
in
    Result
Result
Result
1x|y
2p|q

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks