Table.ToList
TableConverts a table to a list by applying a combiner function to each row.
Syntax
Table.ToList(table as table, optional combiner as nullable function) as listParameters
| Name | Type | Required | Description |
|---|---|---|---|
table | table | Yes | The table to convert. |
combiner | function | No | A function that takes a list of row values and returns a single value. Defaults to Combiner.CombineTextByDelimiter(","). |
Return Value
list — A 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
ResultResult
Result | |
|---|---|
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
Example 2: Join row values into delimited text
let
Source = #table({"A","B"}, {{"x","y"},{"p","q"}}),
Result = Table.ToList(Source, Combiner.CombineTextByDelimiter("|"))
in
ResultResult
Result | |
|---|---|
| 1 | x|y |
| 2 | p|q |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks