Table.FromList

Transforms a list into a table using a specified splitting function called "splitter" for each item in the list. By default, the list is considered to be a collection of text values separated by comma...

Syntax

Table.FromList(list as list, optional splitter as nullable function, optional columns as any, optional default as any, optional extraValues as nullable number) as table

About

Transforms a list into a table using a specified splitting function called "splitter" for each item in the list. By default, the list is considered to be a collection of text values separated by commas. Users have the option to define the number of columns, provide a list of columns, or specify a TableType. Additionally, default and extraValues can be included as optional parameters.

Explanation

Example 1: Generate a table from a list with a column named "Letters" using the default splitter. Usage: Power Query MTable.FromList({"a", "b", "c", "d"}, null, {"Letters"}) Output: Table.FromRecords({ [Letters = "a"], [Letters = "b"], [Letters = "c"], [Letters = "d"] }) Example 2: Create a table from a list using the Record.FieldValues splitter, with the resulting table having "CustomerID" and "Name" as column names. Usage: Power Query MTable.FromList( { [CustomerID = 1, Name = "Bob"], [CustomerID = 2, Name = "Jim"] }, Record.FieldValues, {"CustomerID", "Name"} ) Output: Table.FromRecords({ [CustomerID = 1, Name = "Bob"], [CustomerID = 2, Name = "Jim"] })