Downloads
Power Query MRecordBeginner

Record.FieldValues

Returns the values of all the fields in a record, as a list.

Syntax
Record.FieldValues(record)

Returns: A list of the field values, in the same order as Record.FieldNames.

What it does

Record.FieldValues gives you the values of a record as a plain list, without the names. Use it to total a row, to check that all the amounts in one row add up to a control figure, or to pass a row's values to a list function.

Syntax and arguments

Example

A journal line has debit and credit columns for three accounts in one row, and the reviewer wants to test that the amounts net to zero.

let
    JournalRow = [CashDebit = 500, SalesCredit = -300, TaxCredit = -200],
    Values = Record.FieldValues(JournalRow),
    Net = List.Sum(Values)
in
    Net

Values is {500, -300, -200}, and Net is 0, so the line balances. A nonzero result would point to a line that needs review.

Example: a second, different use

Checking that no field in a row is blank: List.AnyTrue(List.Transform(Record.FieldValues(Row), each _ = null)).

Things to watch

In business terms

Journal balance checks, row totals in a wide layout and cross-checks of a row against a control figure all use the values of a record. A net of zero is a simple sign that a debit and credit set balances.

Related functions

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