Share via


Type.ForRecord

Syntaxis

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

Over

Retourneert een type dat records vertegenwoordigt met specifieke typebeperkingen voor velden.

Voorbeeld

Dynamisch een tabeltype genereren.

Gebruik

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}})

uitvoer

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