Drilldown Conditional Syntax#

When selecting the Drilldown Conditional option, the condition needs to be entered in JSON format into the input box. This section provides syntax details and examples for this configuration.

If an item matching the condition is selected from the dashboard, the conditional drilldown is then carried out.

JSON format#

  • If conditions are all met

  • then carry out actions

  • else Defaults ("default...")

Structure

{
  "conditions": [],
  "actions": [],
  "defaultDrilldown": 1,
  "defaultDashboardId": "",
  "defaultUrl": "",
  "defaultFilterFields": []
}

conditions

conditions: list of conditions on rules.

  • id: “integer” - zero-based

  • name: “text” - condition name

  • type : “OR” or “AND”

    • conditions.type: “AND” means action will be taken when all conditions are met.

    • conditions.type: “OR” means action will be taken when one condition is met.

rules

  • rules: list of rules:

    • ruleid: “integer” - zero-based

    • field: “integer” - zero-based

      Field order in the drilldown tab (0 base)

    • fieldType: “text”, “integer” or “float”

    • operator: “==”, “!=”, “<=”, “>=”, “<”, “>” or “regex”

      • fieldType text operator choices: “==”, “!=”, “regex”

      • fieldType integer and float operator choices: “==”, “!=”, “<=”, “>=”, “<”, “>”

    • value: value of the field; according to fieldType: “text”, “integer” or “float”

actions

List of actions:

  • drilldown: “integer”

    • Drilldown type:

      • 1 (drilldown to other widgets)

      • 2 (drilldown to other dashboard: dashboardid)

      • 4 (drilldown to external link: url)

  • dashboardid: “text”

    The ID is available as dashboard_id URL parameter value when on a dashboard.

  • url: “text”

    The value is a URL containing position variables for filterFields references, whose values in turn are substituted into the URL. The position variables are one based, for example:

    "url": "https://{1}/ui/index.html?{2}"

    refers to the first and second filterFields list entries, which in turn take the format

    "filterFields": [0,1]

    The value of the first filterFields entry is therefore for example substituted into the URL variable {1} above.

  • filterFields: list of fields (“integer” = index number)

    Field order in the drilldown tab (0 base)

Defaults

  • defaultDrilldown: “integer”

  • defaultDashboardid: “text”

  • defaultUrl: “text”

  • defaultFilterFields: list of fields (“integer” = index number)

    Field order in the drilldown tab (0 base)

Examples#

Drilldown to other widgets#

Explanation:

  • If 7th field ("field": 6) data != 0 and 6th field ("field": 5) <= 0 then

    • run action drilldown to other widgets ("drilldown": 1)

      • using filter values of first, second and 4th field ("filterFields": [0,1,3]).

  • If the condition is not met, then

    • run default action which is drilldown to other widgets ("defaultDrilldown": 1)

      • using filter values of first and second field.

JSON:

{
  "conditions": [
    {
      "id": 0,
      "name": "first_condition",
      "type": "AND",
      "rules": [
        {
          "ruleid": 0,
          "field": 6,
          "fieldType": "integer",
          "operator": "!=",
          "value": "0"
        },
        {
          "ruleid": 1,
          "field": 5,
          "fieldType": "float",
          "operator": "<=",
          "value": "0"
        }
      ],
      "actions": [
        {
          "drilldown": 1,
          "dashboardid": "",
          "url": "",
          "filterFields": [
            0,
            1,
            3
          ]
        }
      ]
    }
  ],
  "defaultDrilldown": 1,
  "defaultDashboardId": "",
  "defaultUrl": "",
  "defaultFilterFields": [
    0,
    1
  ]
}

Drilldown to other dashboard#

Explanation:

  • If second field data is “keller, texas” or 5th field is “TX” then

    • run action drilldown to other dashboard ("drilldown": 2, "dashboardid":...)

      • using filter values of first, second and 4th field.

  • If the condition is not met, then

    • run default action which is drilldown to other widgets

      • using filter values of first and second field.

JSON:

{
  "conditions": [
    {
      "id": 0,
      "name": "first_condition",
      "type": "OR",
      "rules": [
        {
          "ruleid": 0,
          "field": 1,
          "fieldType": "text",
          "operator": "==",
          "value": "keller, texas"
        },
        {
          "ruleid": 1,
          "field": 4,
          "fieldType": "text",
          "operator": "==",
          "value": "TX"
        }
      ],
      "actions": [
        {
          "drilldown": 2,
          "dashboardid": "M2OQQMVN3IWI1O2P1686581558847Y2FRT98M8V24GS",
          "url": "",
          "filterFields": [
            0,
            1,
            3
          ]
        }
      ]
    }
  ],
  "defaultDrilldown": 1,
  "defaultDashboardId": "",
  "defaultUrl": "",
  "defaultFilterFields": [
    0,
    1
  ]
}