Record.Combine
Joins a list of records into one record, with all their fields together.
Record.Combine(records)Returns: A single record holding the fields of every record in the list.
What it does
Record.Combine takes a list of records and returns one record with all the fields together. Use it to bring several sets of fields into one row: the header details from one source and the figures from another. The field names must not repeat across the records.
Syntax and arguments
records: a list of records, for example{ [A = 1], [B = 2] }.
Example
A journal header comes from one source and the line figures from another. The query joins them into a single record for the journal import.
let
Header = [JournalNo = "JE-2026-0415", Period = "2026-03"],
Figures = [Account = "6100", Amount = 1250, Currency = "USD"],
JournalLine = Record.Combine({Header, Figures}),
Names = Record.FieldNames(JournalLine)
in
JournalLine
JournalLine has five fields: JournalNo, Period, Account, Amount and Currency. Each source keeps its own fields, and they meet in one row.
Example: a second, different use
Adding several computed fields at once to a row, by listing each record of new fields and combining them with the original.
Things to watch
- If two records have the same field name, the result is an error. Rename one side first with Record.RenameFields.
- Field order follows the order of the records in the list.
- Combining does not change the source records.
- For combining the rows of tables, use Table.Combine or Table.Join, not Record.Combine.
In business terms
Joining header and line details for journal entries, or adding a standard set of tags to each record before it goes into a report, is a common use. Make sure the names do not clash, because a clash is caught as an error, not as a silent overwrite.