Power QueryExercises

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

By Tahir Nas · Examples run in our simulator · Updated

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

A text operation received a record, which is what a row or a nested JSON object is. Pick the field you need first.

Common causes

How to fix it

  1. Select the field: _[Name] or [Name].
  2. Expand the record column with Table.ExpandRecordColumn before using its fields.
  3. To show a whole record as text, use Text.FromBinary(Json.FromValue(record)).

Find the step that fails

Minimal example

Raises the error:

Text.From([Name = "Ana", City = "Porto"])

Fixed:

Text.From([Name = "Ana", City = "Porto"][Name])

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