Downloads
Power Query MRecordIntermediate

Record.ToTable

Converts a record into a two-column table, with one row for each field, a Name column and a Value column.

Syntax
Record.ToTable(record)

Returns: A table with the columns Name and Value.

What it does

Record.ToTable turns one record into a table in which each field becomes a row. The first column holds the field name and the second holds the value. Use it to show the settings, parameters or summary figures of a record in a readable grid, or to make a pivot-friendly list.

Syntax and arguments

Example

A close summary is held as one record of control figures. The reviewer wants it as a list of lines to print in the close pack.

let
    ControlFigures = [RowsLoaded = 412, RowsRejected = 3, ControlTotal = 1805.5],
    AsTable = Record.ToTable(ControlFigures)
in
    AsTable

AsTable has three rows: RowsLoaded with 412, RowsRejected with 3, and ControlTotal with 1805.5. Each control figure now sits on its own line, ready to be reviewed.

Example: a second, different use

Turning a parameter record into a visible table for a parameters sheet, so that users can see the settings a query is using.

Things to watch

In business terms

Close summaries, control totals and settings for a query can be shown as a list, so that a reviewer reads them in one place. A printed list of control figures is easier to sign off than a long record.

Related functions

All Power Query M functions · View as Markdown · M basics