Configure Case Widget

Define Case Widget

The case widget of the Portal dashboard is an interactive case list. Refer to Case List Widget for details.

Below is a sample JSON definition of the case widget in the Portal dashboard.

{
   "type": "case",
   "id": "case-widget",
   "names": [
      {
      "locale": "en",
      "value": "Your Cases"
      },
      {
      "locale": "de",
      "value": "Ihre Vorgänge"
      }
   ],
   "layout": {
      "x": 0, "y": 0, "w": 10, "h": 9,
      "style": "text-color: blue;",
      "styleClass": "your-widget-class"
   },
   "sortField": "name",
   "rowsPerPage": 20,
   "columns": [
      {
         "field": "start"
      },
      {
         "field": "priority",
         "visible": "false"
      },
      {
         "field": "id"
      },
      {
         "field": "name"
      },
      {
         "field": "state",
         "headers": [
            {
            "locale": "en",
            "value": "State"
            },
            {
            "locale": "de",
            "value": "Status"
            }
         ]
      },
      {
         "field": "startTimestamp"
      },
      {
         "field": "actions"
      }
   ]
}

The basic JSON structure of the case widget - type: type of the widget. Use case for a case widget

  • id: ID of the widget

  • names: multilingual name of the widget on the UI.

  • layout: layout definition of the case widget

    • x: HTML DOM Style left is calculated as formula x / 12 * 100%

    • y: HTML DOM Style top is calculated as formula y / 12 * 100%

    • w: HTML DOM Style width is calculated as formula 60 * w + 20 * (w - 1)

    • h: HTML DOM Style height is calculated as formula 60 * h + 20 * (h - 1)

    • styleClass (optional): add CSS classes to HTML DOM of the Case widget

    • style (optional): add inline style to HTML DOM of the Case widget

  • sortField: default sort field for the Case widget

  • sortDescending: default sort direction of the default sort field. The default value is “false” (sort direction is ascending)

  • rowsPerPage: maximum number of cases that are displayed on one page of the case widget. The default is 10 rows per page

  • columns: column configurations for each column in the case widget. You can predefine filters, styles, visibility,… of columns and define custom columns, too.

    • field: field name of the column

      For a standard column, field must be one of these:

      • id: case ID

      • name: case name

      • description: case description

      • state: case business state

      • creator: case creator

      • startTimestamp: creation date and time of the case

      • endTimestamp: end date and time of the case

      • owner: case owner

      • actions: for further actions like access case details, case business details, destroy case

      For custom columns, field is the name of a case custom field. Portal will use the value of the field attribute to get the value of the column.

    • visible: visibility of a column. The default value is “true”. Set to “false” to hide the column.

    • quickSearch: Adds this field to the search scope of the quick search. The default value is false. Set to true to apply search condition for the column.

    • headers: multilingual header of the column.

Custom Columns

The Portal supports custom fields for a case. You can show them on the case widget as a column.

Traditional Custom Columns

You can predefine which column to show, and other attributes such as filter, format, and style. Below is a standard JSON of a custom column.

{
   ...

   "columns": [
      {
         "type": "CUSTOM",
         "field": "supplier",
         "style": "width: 110px"
      }
   ]
}

Besides the attributes explained in the previous section, a custom column has two differences:

  • type: type of the widget column. There are two options: STANDARD and CUSTOM.

  • field: this attribute is the name of the case’s custom field which will be used to get data for the column.

Important

Portal only displays custom fields declared in the custom-fields.yaml file. Refer to Custom Fields Meta Information for more information.

Custom Action Button Columns

Portal supports creating custom action buttons for specific needs. By clicking on these buttons, a custom process is triggered.

Follow these steps to implement it:

  1. Create a new process that will be triggered after clicking on the custom action button. In this example, the process will destroy the case.

    custom-action-button-custom-field

  2. Describe the custom action button in custom-fields.yaml.

    CustomFields:
       Cases:
          DestroyCaseAction:
             Label: Destroy Case Action
             Category: Custom Case Action
             Icon: si si-controls-play
             IsCustomAction: true
    
    • IsCustomAction: true is mandatory to inform Portal that it is an action button.

    • For the Icon, please refer to the streamline icon showcase available in Html Dialog Demos on Axon Ivy Market.

  3. On the process start of the main process, assign a custom field to it.

    custom-action-button-custom-field

Filter Conditions

You can predefined filter conditions for most columns of the case widget. Each column has different conditions. Some columns only accept a list, some only a string and some only accept a string in a special format such as date-time. Please refer to Complex Filter for more details.

Base structure of filter json:

{
   ...

   "columns": [
      {
         "field": "name"
      }
   ],
   "filters" : [
      {
         "field" : "name",
         "values" : [ "Mike ", "Nam" ],
         "operator" : "contains",
         "type" : "standard"
      }
   ]
}
  • field: filter field name corresponding with column name

  • values: filter value, could be a list, a string or a number

  • operator: filter operator, operators can be difference depend on each field type.

    • String column: is, is_not, empty, not_empty, contains, not_contains, start_with, not_start_with, end_with, not_end_with

    • Number column: between, not_between, empty, not_empty, equal, not_equal, less, less_or_equal, greater, greater_or_equal

    • Date column: today, yesterday, is, is_not, before, after, between, not_between, current, last, next, empty, not_empty

  • type: standard for standard column or custom for custom column

  • Date type additional field:

    • periodType: string value, YEAR, MONTH, WEEK, DAY

    • from: string value. E.g.: “03/19/2024”

    • to: string value. E.g.: “01/01/2024”

  • Number type additional field:

    • from: string value. E.g.: “3.0”

    • to: string value. E.g.: “55.2”

There are additional fields dependent on the operator and many specific filters for each field type. Below is the list of filterable columns and their corresponding filter conditions.

Tip

We encourage utilizing dashboard configurations to edit widgets and then leveraging the export dashboard feature to ensure better expectations when customizing these widgets.

Standard Column:

  • name

    {
       ...
    
       "columns": [
          {
             "field": "name"
          }
       ],
       "filters" : [
          {
             "field" : "name",
             "values" : [ "Mike ", "Nam" ],
             "operator" : "contains",
             "type" : "standard"
          }
       ]
    }
    

    This column accepts all operators available for String column. Additionally, it accepts values as a list of strings .

  • description

    {
       ...
    
       "columns": [
          {
             "field": "description"
          }
       ],
       "filters" : [
          {
             "field" : "description",
             "values" : [ "Leave" ],
             "operator" : "not_end_with",
             "type" : "standard"
          }
       ]
    }
    

    This column accepts all operators available for String column. Additionally, it accepts values as a list of strings .

  • state: Case business state

    {
       ...
    
       "columns": [
          {
             "field": "state"
          }
       ],
       "filters" : [
          {
             "field" : "state",
             "values" : [ "DESTROYED", "DONE", "OPEN" ],
             "operator" : "in",
             "type" : "standard"
          }
       ]
    }
    

    This column only accepts a list of case business state names as the filter value. The available filter operator is in.

    Refer to Case business states for available case business states.

  • creator

    {
       ...
    
       "columns": [
          {
             "field": "creator"
          }
       ],
       "filters" : [
          {
             "field" : "creator",
             "values" : [ "backendDev2", "gm1" ],
             "operator" : "in",
             "type" : "standard"
          },
          {
             "field" : "creator",
             "operator" : "current_user",
             "type" : "standard"
          }
       ]
    }
    

    This column only accepts a list of usernames as filter value for the case creator’s username. The available filter operators are in, not_in and current_user. The current_user operator does not require value field.

  • startTimestamp and endTimestamp: created date and finished date of the Case

    {
       ...
    
       "columns": [
          {
             "field": "creator"
          }
       ],
       "filters" : [
          {
             "field" : "startTimestamp",
             "to" : "03/12/2024",
             "operator" : "after",
             "type" : "standard"
          },
          {
             "field" : "startTimestamp",
             "operator" : "current",
             "periodType" : "MONTH",
             "type" : "standard"
          },
          {
             "field" : "startTimestamp",
             "from" : "03/01/2024",
             "to" : "03/17/2024",
             "operator" : "between",
             "type" : "standard"
          },
          {
             "field" : "startTimestamp",
             "operator" : "last",
             "periods" : 2,
             "periodType" : "YEAR",
             "type" : "standard"
          },
          {
             "field" : "startTimestamp",
             "from" : "03/19/2024",
             "operator" : "is",
             "type" : "standard"
          },
          {
             "field" : "startTimestamp",
             "operator" : "empty",
             "type" : "standard"
          }
       ]
    }
    

    This column accepts all operators available for Date column. Fields may vary depending on the operator. The JSON example above covers most use cases for the Date field. Acceptable date formats: dd.MM.yyyy and MM/dd/yyyy.

  • category

    {
       ...
    
       "columns": [
          {
             "field": "category"
          }
       ],
       "filters" : [
          {
             "field" : "category",
             "values" : [ "LeaveRequest", "Leave_Request_1" ],
             "operator" : "in",
             "type" : "standard"
          }
       ]
    }
    

    The available filter operators are in, not_in, no_category, contains and not_contains. The no_category operator does not require value field.

Custom Field Column:

{
   ...

   "columns": [
      {
         "field": "InvoiceNumber"
      }
   ],
   "filters" : [
      {
         "field" : "InvoiceNumber",
         "value" : "566.00",
         "operator" : "less_or_equal",
         "type" : "custom"
      }
   ]
}