Widget Filters

Narrow down observations displayed in this widget. Use a json object to map field name to a value (or list of values) to filter by.

Example filters configuration with filtering on bool, text and array fields.
{
    "boolean_field": true,
    "text_field": "test",
    "array_field": ["one", "two", "three"]
}

Placeholders can be used to dynamically filter data based on system data or auditor currently viewing it.

  • {auditor.pk}: current auditor id

  • {today}: fetches current date ex: 2023-01-01"

  • {now}: Fetches current datetime ex: 2023-01-01T00:00:00.000000+00:00

Example filters configuration with filtering on bool, text and array fields.
{
    "auditor_field": "{auditor.pk}",
    "date_field": "{today}",
    "datetime_field": "{now}",
}

Alongside placeholders for date and datetime fields we can use certain lookups to filter data

Available lookups:

  • gt: Greater than

  • gte: Greater than or Equal

  • lt: Less than

  • lte: Less than or equal

Example filters configuration with filtering on bool, text and array fields.
{
    "date_field__gt": "{today}",
    "datetime_field__gte": "{now}",
    "date_field__lt": "2023-01-01",
    "datetime_field__lte": "{now}",
}