Skip to main content


Learn how to filter data.

A collection can be filtered using Collection.Filter. A list can be filtered using List.Filter.

These functions behave similarly: each receives the collection or list to filter, and then a function that returns true for all elements that should pass the filter.

For instance, in the example below, a dataset is read and the resulting collection is filtered in order to return only the rows that match a given country name. Specifically, this example reads a dataset in airports and returns only those airports in a given country.

main(country: string) =
airports = Csv.InferAndRead("")
Collection.Filter(airports, a -> a.Country == country) // airports in a given country

If you want to try this example, you can deploy the following endpoint:

Filter rows in a collection
Learn how to filter rows in a collection.

Sample usage:


For instance, to ask for airports in Portugal, use: