For the complete documentation index, see llms.txt. This page is also available as Markdown.

Filtering, Sorting & Limiting

Control exactly which related records feed a rollup or lookup field by filtering, sorting and limiting them.

A rollup field configured with a limit, a filter and a sort, alongside the values it produces
A rollup with all three controls set — limited to 5 records, filtered to Status is Active, sorted by Hours — and the values it produces for each record

By default, a rollup or lookup field uses every related record it can reach through the relationship you chose. Filters, sorting and limits let you narrow that down, so the field only summarizes or pulls the records you actually care about.

All three controls live in the same place — the field editor, underneath the relationship and field you're summarizing or looking up. They work on both rollup and lookup fields, and you can combine them.

Limit, Filter and Sort in the rollup field editor
Limit, Filter and Sort sit together in the field editor — here on a rollup summing Hours

Filtering

A filter decides which related records are included.

Instead of counting every task on a project, count only the active ones. Instead of looking up every assignee's email, look up only the ones whose job title is Manager.

  • Open the field editor for your rollup or lookup field.

  • Under Filter, add a condition — pick a field on the related table, an operator, and a value.

  • Add more conditions to narrow it further, or group them to match on any one of several conditions.

Filtered values stay up to date automatically. If a record changes so that it now matches — or no longer matches — your filter, the rollup or lookup recalculates.

Editing a filter condition on the related table
Editing a condition — pick a field on the related table, an operator and a value

Sorting

Sorting decides the order of the related records before they're used.

For a lookup, this is the order the values appear in on the record. For a rollup, it matters most when combined with a limit — it's what decides which records make the cut.

  • Under Sort, choose a field on the related table and a direction.

  • Add more sort rules to break ties.

A sort rule on the related table, inside the lookup field editor
A sort rule on the related table — Hours, biggest to smallest

Limiting

A limit caps how many related records are used.

Combined with sorting, this is how you build "top N" fields — roll up the value of the 10 most recent deals, or look up the email of the 3 most recently assigned users.

  • Under Limit, enter the maximum number of records to use.

If you don't set a sort, records are limited using the default order — most recently created first.

Setting the limit to 1 turns the field into a single value rather than a list. This changes how you can use it elsewhere in your app — for example, a limited lookup on a linked field behaves as a single linked record.

A lookup field limited to 1 related record
A lookup limited to 1 and sorted by Hours — it returns each project's biggest task
Unlimited lookups return a list; a lookup limited to 1 returns a single value
Unlimited lookups return a list of values; limited to 1, the field returns a single value

Putting it together

A worked example — "the value of my 5 biggest open deals":

  • Field: a rollup on the Company → Deals relationship, summing Value

  • Filter: Stage is not Closed

  • Sort: Value, descending

  • Limit: 5

The rollup now sums the five highest-value open deals for each company, and updates itself whenever a deal's value or stage changes.

Last updated

Was this helpful?