Skip to main content



CollectionLookup Function

The CollectionLooup function returns the value of a field or expression for the first collection member that satisfies a given filter expression.

Syntax 1

CollectionLookup(collection, returnField, filter)

The CollectionLooup function returns the value of a field or expression for the first collection member that satisfies a given filter expression.

Arguments

collection Collection - A collection.

returnField Field - The field to return.

filter FilterExpression - The filter criteria.

Syntax 2

CollectionLookup(collection, returnExpression, filter)

The CollectionLooup function returns the value of a field or expression for the first collection member that satisfies a given filter expression.

Arguments

collection Collection - A collection.

returnExpression Any - An expression that resolves to the return value.

filter FilterExpression - The filter criteria.

Syntax 3

CollectionLookup(collection, returnField, filter, default)

The CollectionLooup function returns the value of a field or expression for the first collection member that satisfies a given filter expression.

Arguments

collection Collection - A collection.

returnField Field - The field to return.

filter FilterExpression - The filter criteria.

default Any - The default return value if no members match the filter criteria.

Syntax 4

CollectionLookup(collection, returnExpression, filter, default)

The CollectionLooup function returns the value of a field or expression for the first collection member that satisfies a given filter expression.

Arguments

collection Collection - A collection.

returnExpression Any - An expression that resolves to the return value.

filter FilterExpression - The filter criteria.

default Any - The default return value if no members match the filter criteria.

Remarks

Example:

CollectionLookup(Vehicles, ID, Year=1999 And Make="Ford"); // returns 42

Example:

CollectionLookup(Vehicles, ID, Year=1955 And Make="DeLorean", -1); // returns -1