Type.ForRecord

Sözdizimi

Type.ForRecord(fields as record, open as logical) as type

Hakkında

Alanlarda belirli tür kısıtlamaları olan kayıtları temsil eden bir türü döndürür.

Example

Dinamik olarak bir tablo türü oluşturun.

Kullanım

let
    columnNames = {"Name", "Score"},
    columnTypes = {type text, type number},
    rowColumnTypes = List.Transform(columnTypes, (t) => [Type = t, Optional = false]),
    rowType = Type.ForRecord(Record.FromList(rowColumnTypes, columnNames), false)
in
    #table(type table rowType, {{"Betty", 90.3}, {"Carl", 89.5}})

Çıkış

#table(
    type table [Name = text, Score = number],
    {{"Betty", 90.3}, {"Carl", 89.5}}
)