Skip to content

Filters and conditional formatting

Show only the records that match your conditions, and color cells and rows by their values.

A filter shows only the records that match its conditions. A Base has two levels of filters:

  • The Base’s filters select the files that every view starts from, such as the notes in one folder. Edit them in Base settings. A database Base holds its own records, so it has no Base filters.
  • A view’s filters select records from those files for one database view. In a to-do list, these filters belong to the selected list and save immediately. Shared named views keep its presentation. See To-do lists.
  1. Select Filter in the toolbar, then Add filter, and choose a property. You can also open the menu of a column and select Filter column…, or open the menu of a cell and select Filter to this value.
  2. Choose a condition and a value.

Each filter shows as a chip. The conditions depend on the type of the property:

  • Options and text: is any of, is none of, is empty, is not empty.
  • Numbers: is, is not, is less than, is greater than, is at most, is at least, is between, is not between, is empty, is not empty.
  • Checkboxes: is checked, is not checked.
  • Dates (in the filter bar): is before, is after, is on, is in the last, is in the next.

In a database there are no folders: the folder filter is called Section, with is and is not, for example “Section is 2024”.

The filter bar above the records shows the view’s filters as chips. Select a chip to change it, or select Remove filter.

To add a quick filter for a column, open the menu of the column and select Show in filter bar. To hide the bar, turn off Show filter bar in the More table actions menu.

Open Base settings to edit the filters that every view starts from. This editor can combine conditions: select Add filter group. A group is true when All, Any or None of its conditions are true. Groups can be inside groups.

Its conditions depend on the type of the property:

  • Text: is, is not, contains, does not contain, starts with, ends with, is any of, is none of, is empty, is not empty.
  • Lists and selects: is any of, is none of, is empty, is not empty.
  • Tags: has any of, has none of. A tag also matches its nested tags.
  • Numbers: is, is not, is less than, is greater than, is at most, is at least, is between, is not between, is empty, is not empty.
  • Dates: is before, is after, is on, is in the last (days), is in the next (days), is empty, is not empty.
  • Checkboxes: is checked, is not checked.
  • Folder: is in, is not in.

You can also filter by the file: Folder, File name, File extension, File path, Tags, Created, Modified and File size.

A filter is a formula that is true for the records to keep. Select Edit as code to see and change a condition, or Edit as YAML to see all the Base’s filters. Select Edit with fields to go back. Some formulas cannot show as fields. See Formulas.

A formatting rule colors the cells or the rows that match its conditions. For example, it can color late projects red. The conditions of a rule are filters: they work as the Base’s filters do.

  1. Open Conditional format in the toolbar, then New rule.
  2. Under When, choose the Property, the Condition and the Value of the first condition. A new condition starts on the first property that the view shows. The conditions are the same as for the Base’s filters. Dates also have is today, is overdue, is this week and is this month, which need no value.
  3. To add a condition, select Add condition. Choose whether All, Any or None of the conditions must be true. Select Add condition group to put a group inside the rule. Select Edit as code to write a condition as a formula.
  4. Choose Apply to: Cell or Whole row. For a cell, choose the cell to format in Format cell. It follows the property of the first condition until you choose another one, so a rule can color the name when the status is Done.
  5. Choose the style: Bold, Strikethrough, Text colour (a preset swatch or a custom colour), Fill colour (a preset swatch or a custom colour) and Fill strength. Turn on Pills use the fill colour to color the option pills too.

While you edit a rule, the table shows the rows it matches, and the form shows how many rows match.

Select Add rule to save a new rule. It is available when every condition is complete. In a rule that you open from the list, style changes save at once, and condition changes save after a short pause. Select All rules to go back to the list. The rules apply in their order. You can turn a rule off, move it up or down, or remove it.

Rules that compare with today follow the date: a view that stays open past midnight shows the new day’s matches.

A rule can use a formula column in its conditions, or a condition written as code. A formula can use today() and now(). For example, this condition is true for a task that is late and not done:

!note.done && date(note.due) < today()

Write it with Edit as code, and apply the rule to the Whole row.

The rules are saved in the Base’s basesStudio block, which Obsidian does not read. Each rule saves its conditions in filters, in the same form as the view’s filters.

Rules from older versions of BaseStudio saved one property, a condition and a value. BaseStudio reads them as filters and saves them in the new form when you change a rule of the view. Two conditions show differently:

  • An old is in the next N days or is in the last N days covered today and N more days. It opens as is in the next N+1 days or is in the last N+1 days, which covers the same days.
  • contains on a list now matches a whole item. An old rule also matched part of an item’s text.

An older version of BaseStudio keeps a rule in the new form unchanged, but does not apply it.