Formula fields that are filtered by the context they're viewed in

I’m not exactly how to describe this, so maybe it’s been requested before (or can already be done in some way)…apologies if this sounds confusing!

I wish we could use a single formula where the value is set dynamically by the context it’s being viewed in.

Or put in another way, I wish we could use the “this” function within formula fields to reference entities in related databases.

Here’s an extremely simple and common use case. If I wanted a count of “tasks” that are assigned to a “user” in a “sprint”, I’d like to use a a single formula field on the user that looks something like:

Tasks.Filter(Sprint.Name = This.Sprint).Count()

So if I looked at that field while inside of different Sprint entities, it could have a unique value:

  • In Sprint 1 the value could be 12
  • In Sprint 2 the value could be 15
  • In Sprint 3 the value could be 10

Obviously, if I viewed the field directly on the entity on within the raw database, there is no context provided for that formula to work and it would need to be displayed as empty/blank or something like “Error: Context Required”

Currently, the only way to achieve such a basic metric is by having a ton of formulas that would need constant upkeep, or a report which isn’t able to have it’s data displayed in a context/relation view.

  1. Creating fields in the sprint database for each user called “User X’s Task Count” with the hardcoded formula:

Tasks.Filter(User.Name = “User 1”).Count()

Not really sustainable since each sprint has different/new users and it would be crazy to have to micromanage formulas fields for each user all the time.

  1. Creating a field on the user database for each sprint with the hardcoded formula

Tasks.Filter(Sprint.Name = “Sprint 1”).Count()

Unsustainable for the same reasons as #1, only even crazier since we have new sprints every week, so we’d need to create multiple new formula fields each sprint, for each user!

  1. Create a report, since they allow the “This” function to be used more broadly

Doesn’t really solve what I’m looking for, which is to have the data displayed directly in context/relation views alongside their entities and not have to go to a completely different view to access them.

A formula field calculation knows nothing about the context of where the entity is being viewed, or by whom the entity is being viewed, so this is fundamentally not possible.
The result of a formula field is always the same for all people*, no matter the ‘context’ of the entity.

*minor exception is that formulas that result in a datetime value will be localised to the user’s timezone

It could be that you might need something like this:

I know, hence the request. :slight_smile:

Your reporting system already allows for this type of contextual/dynamic logic. But from what I can tell it was developed on an island and is isolated from almost everything else in Fibery. :frowning:

Yeah, it’s similar to that other request in the sense of wanting unique calculations based on the content within a view, whether it be board or table or list.

I wonder if the request can be reworded to express what you’re looking for without assuming that it is something related to formula fields.
We already have aggregation calculations for columns in table view, so perhaps you’re looking for these to be added per group as well?

Or maybe you need aggregations per row/column in a board view…?
… and aggregations in list view too?

Aggregations by row/column in board view would likely cover many of the situations I’m thinking of.

My only issue with aggregations on table view is that they can’t be filtered. Here’s a request I made a few weeks back about it: Allow specific databases to be excluded from column calculations

I usually default to formula improvements being an ideal solution because the more they get improved the more flexibility and autonomy all your users have to customize their workspaces themselves without waiting/relying on specific feature requests that might never be prioritized. :slight_smile: