Working with the Count field

The Count field automatically counts the number of linked records from another table, giving you a simple, real-time summary of related data.

This guide covers what a Count field is, the prerequisites for adding a Count field, how to create and configure a Count field, how to sort and filter by the count, and the difference between a Count field and a Rollup field.

Learn more: Configure field types

Configuring a new Count field in Baserow

What is a Count field?

A Count field works after you have set up a Link-to-table field. It looks at that link and displays a number representing how many records are linked to that specific row.

This field is read-only, meaning you cannot type in the number yourself. It’s an automatic calculation that updates every time you add or remove a record in the Link-to-table field.

How to create a Count field

Prerequisite

You must have an existing Link-to-table field in your table before you can create a Count field.

Steps

  1. In your table, click the plus sign + to add a new field.
  2. Give the field a name (e.g., “Total Orders” or “Task Count”).
  3. Select Count from the field type dropdown menu.
  4. From the Select a link row field dropdown, choose the Link-to-table field you want to count. If you have multiple links, select the one that corresponds to the records you want to total.
  5. Click Create.

The new read-only field will now be populated with the total count of linked records for each row.

Example: Customers and Orders

Imagine you have two tables, you want to see the total number of orders each customer has placed, directly in your Customers table.

  1. Customers table: Contains Customer Name and Email.
  2. Orders table: Contains Order ID and a Link-to-table field called [Link] Customer.

Solution: In your Customers table, you would:

  1. Create a Count field named “Total Orders.”
  2. Configure this new field to “watch” the [Link] Customer field (which shows up in your Customers table as a link to Orders).

The “Total Orders” field will now automatically display a number (e.g., “3”) for each customer, showing exactly how many orders they are linked to.

Sorting and filtering

You can easily use a Count field to sort or filter your table. For example, you could:

  • Sort your “Customers” table by the “Total Orders” field in descending order to see your most active customers first.
  • Filter your “Tasks” table to only show records where the “Sub-task Count” is greater than 0.

Frequently asked questions

What’s the difference between a Count field and a Rollup field?

They are very similar, but have one key difference:

  • Count field: This only counts the number of linked records.
  • Rollup field: This can perform other calculations. It can sum, average, find the min/max, or count based on a specific field within the linked records (e.g., “Sum of Order Amount” or “Average Rating”).

If you only need to know “how many,” the Count field is the simplest and fastest option.

Why can’t I edit the number in a Count field?

The Count field is read-only because it’s an automatic calculation, not a data entry field. The number in this field is a result of how many records are linked. To change the number, you must add or remove links in the associated Link-to-table field.

Does the Count field update automatically?

Yes. As soon as you add or remove a link in the Link-to-table field, the Count field will update in real-time to show the new total.


Still need help? If you’re looking for something else, please feel free to make recommendations or ask us questions; we’re ready to assist you.