Table.FromList
Turns a list into a table with one column, or splits each item into several columns with a splitter.
Table.FromList(list as list, optional splitter as nullable function, optional columns as any, optional default as any, optional extraValues as nullable number) as tableReturns: A new table built from the list.
What it does
Table.FromList turns a list into a table. With the splitter Splitter.SplitByNothing(), each item becomes one row in a single column. With a splitter for text, such as one that splits at a bar or a comma, each item is cut into several columns. It is the usual way to turn a list that a function produced into a table that the rest of the query can use.
Syntax and arguments
- list: the list to convert. Required.
- splitter: how to split each item.
Splitter.SplitByNothing()keeps each item whole. Optional. - columns: the column names, in braces. Optional, but recommended.
- default: a value for missing pieces when splitting. Optional.
- extraValues: what to do with extra pieces.
ExtraValues.Error,ExtraValues.IgnoreorExtraValues.List. Optional.
Example
A list of month-end dates is needed as a single column for a calendar lookup. Each date is one row in a column named Month end.
let
MonthEnds = {#date(2026, 1, 31), #date(2026, 2, 28), #date(2026, 3, 31)},
AsTable = Table.FromList(MonthEnds, Splitter.SplitByNothing(), {"Month end"}, null, ExtraValues.Error)
in
AsTable
Each date becomes a row, in one column called Month end. The list is not split, because each item is a single value.
Example: a second, different use
A list of account codes and names is written as "1000|Cash". Each item is split at the bar into two columns, Account and Name.
let
Pairs = {"1000|Cash", "1100|Receivables", "2000|Payables"},
Split = Table.FromList(Pairs, Splitter.SplitTextByDelimiter("|"), {"Account", "Name"}, null, ExtraValues.Error)
in
Split
Things to watch
- With Splitter.SplitByNothing, the list items must be single values. A record or a nested list needs a different step.
- An item with more pieces than columns is handled by the extra values setting. ExtraValues.Error stops the query, which is usually what you want while building.
- The result is text when the splitter splits text. Set the types after.
- Query folding: a table built from a list does not fold to a database.
In business terms
Lists of dates, codes and references are produced by many functions in a query. Turning them into a table lets them be joined, filtered and reported like any other data.