Table.FromRecords
將記錄清單轉換成資料表。
Syntax
Table.FromRecords(
records as list,
optional columns as any,
optional missingField as MissingField.Type
) as table
Remarks
將指定的記錄清單轉換成資料表。
-
records: 要轉換為資料表的記錄清單。 -
columns: (選用) 資料表的欄位名稱清單,或資料表類型。 -
missingField: (選用) 指定處理資料列中遺漏的欄位之方式。使用下列其中一個值:MissingField.Error: 任何遺漏的欄位都會產生錯誤 (預設)。MissingField.UseNull: 任何遺漏的欄位會以null值表示。
在此參數中使用
MissingField.Ignore會產生錯誤。
Examples
Example #1
從記錄建立資料表,使用記錄欄 位名稱做為資料行名稱。
Table.FromRecords({
[CustomerID = 1, Name = "Bob", Phone = "123-4567"],
[CustomerID = 2, Name = "Jim", Phone = "987-6543"],
[CustomerID = 3, Name = "Paul", Phone = "543-7890"]
})
Result:
#table(type table[CustomerID = any, Name = any, Phone = any],
{
{1, "Bob", "123-4567"},
{2, "Jim", "987-6543"},
{3, "Paul", "543-7890"}
})