Table of contents
TOC
Collapse the table of content
Expand the table of content

Table.FromRecords

Owen Duncan|Last Updated: 8/17/2018

Table.FromRecords(records as list, optional columns as any, optional missingField as nullable number) as table

About

Converts records, a list of records, into a table.

Example 1

Create a table from records, using record field names as column names.

Table.FromRecords({[CustomerID = 1, Name = "Bob", Phone = "123-4567"], [CustomerID = 2, Name = "Jim", Phone = "987-6543"], [CustomerID = 3, Name = "Paul", Phone = "543-7890"]})

CustomerIDNamePhone
1Bob123-4567
2Jim987-6543
3Paul543-7890

Example 2

Create a table from records with typed columns and select the number columns.

Table.ColumnsOfType(Table.FromRecords({[CustomerID=1, Name="Bob"]}, type table[CustomerID=Number.Type, Name=Text.Type]), {type number})

CustomerID
© 2018 Microsoft