Share via


Table.FromList

Sözdizimi

Table.FromList(list as list, optional splitter as nullable function, optional columns as any, optional default as any, optional extraValues as nullable number) as table

Hakkında

İsteğe list bağlı bölme işlevinisplitter listedeki her öğeye uygulayarak listeyi tabloya dönüştürür. Varsayılan olarak, listenin virgülle bölünmüş metin değerlerinin listesi olduğu varsayılır. İsteğe bağlı columns olarak sütun sayısı, sütun listesi veya TableType olabilir. İsteğe bağlı default ve extraValues de belirtilebilir.

Örnek 1

Varsayılan bölücü kullanarak bir listeden tablo oluşturun.

Kullanım

Table.FromList(
    {"a,apple", "b,ball", "c,cookie", "d,door"},
    null,
    {"Letter", "Example Word"}
)

Çıkış

Table.FromRecords({
    [Letter = "a", #"Example Word" = "apple"],
    [Letter = "b", #"Example Word" = "ball"],
    [Letter = "c", #"Example Word" = "cookie"],
    [Letter = "d", #"Example Word" = "door"]
})

Örnek 2

Özel bölücü kullanarak bir listeden tablo oluşturun.

Kullanım

Table.FromList(
    {"a,apple", "b,ball", "c,cookie", "d,door"},
    Splitter.SplitByNothing(),
    {"Letter and Example Word"}
)

Çıkış

Table.FromRecords({
    [#"Letter and Example Word" = "a,apple"],
    [#"Letter and Example Word" = "b,ball"],
    [#"Letter and Example Word" = "c,cookie"],
    [#"Letter and Example Word" = "d,door"]
})

Örnek 3

Record.FieldValues ayırıcısını kullanarak listeden bir tablo oluşturun.

Kullanım

Table.FromList(
    {
        [CustomerID = 1, Name = "Bob"],
        [CustomerID = 2, Name = "Jim"]
    },
    Record.FieldValues,
    {"CustomerID", "Name"}
)

Çıkış

Table.FromRecords({
    [CustomerID = 1, Name = "Bob"],
    [CustomerID = 2, Name = "Jim"]
})