Record.FromList
The function retrieves a data record based on a specified list of field values and a set of fields. Fields can be identified using either a list of text values or a record type. An error will be gener...
The function retrieves a data record based on a specified list of field values and a set of fields. Fields can be identified using either a list of text values or a record type. An error will be generated if the specified fields are not distinct.
Create a data record using a list of field values and a list of field names.
To do this in Power Query M, use the MRecord.FromList function with the following syntax:
MRecord.FromList({1, "Bob", "123-4567"}, {"CustomerID", "Name", "Phone"})
The output will be:
[CustomerID = 1, Name = "Bob", Phone = "123-4567"]
Create a data record using a list of field values and a record type.
To accomplish this in Power Query M, use the MRecord.FromList function with the following syntax:
MRecord.FromList({1, "Bob", "123-4567"}, type [CustomerID = number, Name = text, Phone = number])
The output will be:
[CustomerID = 1, Name = "Bob", Phone = "123-4567"]