Record.FromTable Function in Power Query
The Record.FromTable function in Power Query is used to convert a table with two columns (field names and values) into a record.
Syntax
Record.FromTable(table as table) as record
Example: Create a record from a table.
Power Query M
let
// Creating a table with name-value pairs
Source = Table.FromRecords(
{
[Name = "EmployeeID", Value = 1],
[Name = "Name", Value = "Ashish"],
[Name = "Company", Value = "TCS"]
}
),
// Converting the table into a record
return = Record.FromTable(Source)
in
return The output of the above code will be:
[EmployeeID = 1, Name = "Ashish", Company = "TCS"]