Base Color Conditional Formatting

Bases are a visual tool. This makes them better, visually.

Use case or problem

I’d like the bases to use conditional formatting & use colors.

e.g. in spreadsheets, this changes cell a certain way if it meets the filter requirement.

A light hue if custom field column A is less than than another, a different hue if not, etc.

Proposed solution

Follow best practices. E.g. greater than, less than. It looks like the tab has the same kind of logic for filtering.

Current workaround (optional)

I just copy-paste the data and put it in a spreadsheet manually.

23 Likes

I started using Bases a few days back, it’s fantastic so far, I have to admin that prior to creating one I though I’d have to code it in Yaml, I didn’t realise it had full GUI support to filter, sort, create views etc. Very happy now.

Having moved some of my project tracking to Obsidian from Excel, I would love to have some form of conditional formatting built in. For example, I have a column that highlights who the next action is with, I’d like to be able to colour all the ones with my name in, to make it very clear that those are ones I need to focus on next etc. Something like the conditional formatting options available in Google Sheets would be great.

2 Likes

Wonderful Feature Request!!!

I have another use case:

In this table I log some nutrition habits. It would be nice to mark these lines, which are around breakfest, lunch and dinner with different colours.

So the conditional formating would relate to the clock-information in the first column.

I highly support this feature request!

In my use case I have string properties that I want to be visually distinct so that patterns of value co-occurrence of different properties can be observed.

So far, I use formulas that show the values with emojis as a workaround. Support of formatting and conditional formatting in Obsidian Bases would greatly improve the experience.

I currently use the DB Folder plugin to get the conditional color formatting on the table. It change the colour and background of the text within the cell depending on the value of the cell.

Would love to see the same feature on Obsidian bases. Here is my current view using the “DB Folder” plugin.

3 Likes

To add an example screenshot: colouring cell itself greatly improves my ability to understand spreadsheets. Instead of seeing a sea of numbers, you instantly see patterns in numbers themselves. This way, you don’t even need to use charts!

Screenshot below showcases Google Spreadsheets >> Conditional Formatting >> Color Scale feature. I chose a set of colours for each column and that’s it

3 Likes

I have a variety of use cases for conditional formatting.

For one I have a list of fountain pen inks and as the number grows it would be nice to be able to color the cell or row with the color of the ink. In the simplest case this is just a list of exact matches along with their text styling.

Here is an example of this in DBFolder:

In another I have a list of camera lenses. Lenses have many different attributes and the wall of numbers makes it hard to visually parse. What I like to do is give columns different color ranges. Like red to green for focal length, and pink to blue for aperture, etc. That way, depending on the attribute that matters for the situation (light for aperture, viewing angle for focal distance), it is very quick to pick out the correct lens. This requires a more dynamic approach, with starting ending and possibly midpoint colors and interpolation.

Here is an example of this in Google Sheets:

Any base that has a “rating” or any other mathematically comparable property would also benefit from conditional formatting.

Note that these examples are based on column, not per-cell or per-row. This means it could be stored in the column configuration key.

Possible exact match encoding:

properties:
  status:
    displayName: Status
    conditionalFormattingMatch:
      OnHold:
        fg: #FF0000

Along with basic fg and bg, it could also support cssclasses so that users could customize them however they wish without adding every possible formatting option into the column settings editor.

Possible range encoding:

properties:
  status:
    displayName: Status
    conditionalFormattingRange:
      max:
        style:
          bg: #FF0000
        value: 50
      mid:
        style:
          bg: #FFFF00
        value: 30
      min:
        style:
          bg: #00FF00
        value: 10

Ranges probably wouldn’t be able to use cssclasses, or at least not in a way that interpolates between them. While technically possible, it would probably be infeasible. So I would suggest only supporting basic formatting.

The encoding could be extended with formulas, using the existing formulas key and established syntax, like:

formulas:
  kelvin_max: max(filtered.property("kelvin"))
properties:
  status:
    displayName: Kelvin
    conditionalFormattingMatch:
      formula.kelvin_max:
        fg: #FF0000

The above implies a filtered object which represents the records displayed in the current view which has a property function which returns the list of values assigned to the named property across the files displayed.

This is actually closer to how I set up my conditional formatting in Sheets. I generally tell it to figure out the value range itself. So as new values are added, the max/min are always the same color.