跳至主要内容

Table.IsEmpty

指出資料表是否包含任何資料列。

Syntax

Table.IsEmpty(
table as table
) as logical

Remarks

指出 table 是否包含任何資料列。如果沒有任何資料列 (亦即資料表是空的),則傳回 true, 否則傳回 false

Examples

Example #1

判斷資料表是否是空的。

Table.IsEmpty(
Table.FromRecords({
[CustomerID = 1, Name = "Bob", Phone = "123-4567"],
[CustomerID = 2, Name = "Jim", Phone = "987-6543"],
[CustomerID = 3, Name = "Paul", Phone = "543-7890"]
})
)

Result:

false

Example #2

判斷資料表 ({}) 是否為空的。

Table.IsEmpty(Table.FromRecords({}))

Result:

true

Category

Table.Information