Power QueryExercises

Expression.Error: We cannot convert a value of type Record to type Table

By Tahir Nas · Examples run in our simulator · Updated

Expression.Error: We cannot convert a value of type Record to type Table.

A table function such as Table.Combine received a record (one row) where it needs a table. Lists of records from JSON are the usual source.

Common causes

How to fix it

  1. Wrap rows: Table.FromRecords({record}) turns one or more records into a table.
  2. For JSON arrays of objects, use Table.FromRecords(json) or Table.FromList then expand.
  3. Check each item's type with Value.Is(item, type table) before combining.

Find the step that fails

Minimal example

Raises the error:

Table.Combine({#table({"A"}, {{1}}), [A = 2]})

Fixed:

Table.Combine({#table({"A"}, {{1}}), Table.FromRecords({[A = 2]})})

Both snippets are run by the Power Query Exercises simulator on every build: the first must raise Expression.Error, the second must run.

Practise avoiding it

Related lessons

Similar errors