Skip to main content

Table.Contains

Tiek norādīts, vai tabulā ir ietverta norādītajam ierakstam atbilstoša rinda.

Syntax

Table.Contains(
table as table,
row as record,
optional equationCriteria as any
) as logical

Remarks

Tiek norādīts, vai tabulā table ir ietverta norādītajam ierakstam row atbilstoša rinda. Varat norādīt papildu parametru equationCriteria, lai kontrolētu tabulas rindu salīdzinājumu.

Examples

Example #1

Nosakiet, vai tabulā ir ietverta rinda.

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

Result:

true

Example #2

Nosakiet, vai tabulā ir ietverta rinda.

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

Result:

false

Example #3

Nosakiet, vai tabulā ir ietverta rinda, salīdzinot tikai kolonnu [Name].

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

Result:

true

Category

Table.Membership