Lotus.Storage.DashboardCardFilterMapping (Lotus v0.16.4)

Copy Markdown View Source

Maps a dashboard filter to a query variable within a card.

This schema establishes the connection between a dashboard-level filter and the query variable it controls within a specific card. When the filter value changes, it is passed to the query as the specified variable.

Transform

The optional transform field allows value transformation before passing to the query variable. Common use cases:

  • Date range filters that need to split into start_date and end_date variables
  • Type coercion (e.g., string to integer)
  • Default value override

Example transform config:

{
  "type": "date_range_start",
  "format": "YYYY-MM-DD"
}

Summary

Types

t()

@type t() :: %Lotus.Storage.DashboardCardFilterMapping{
  __meta__: term(),
  card: Lotus.Storage.DashboardCard.t() | Ecto.Association.NotLoaded.t(),
  card_id: term(),
  filter: Lotus.Storage.DashboardFilter.t() | Ecto.Association.NotLoaded.t(),
  filter_id: term(),
  id: term(),
  inserted_at: DateTime.t(),
  transform: map() | nil,
  updated_at: DateTime.t(),
  variable_name: String.t()
}

Functions

changeset(mapping, attrs)

new(attrs)

update(mapping, attrs)