# Filtering the task list and case list

In the Eximee Dashboard, on the task list and the case list, it is possible to filter data.

## Basic filtering

The filtering mechanism for the task list and the case list allows tasks to be searched by a process variable **SEARCH\_STRING**. Multiple fields can be passed to the variable combined into a single string (e.g. separated by commas), which allows searching for data by a fragment of a value. The filter works based on the operator `LIKE` known from SQL.

The value of the variable **SEARCH\_STRING** should contain all data by which the user should be able to search.

Example script setting the value for the variable **SEARCH\_STRING**:

```js
def submittedLeads = execution.getVariable("submittedLeads")
def rejectedLeads = execution.getVariable("rejectedLeads")
def businessKey = execution.getVariable("start.formInstanceNumber")
def lead = execution.getVariable("Lead")
def cif = execution.getVariable("CIF_Klienta")
def time = execution.getVariable("Czas_lokalny")
def modSkp = execution.getVariable("SKP_Wypełniającego")
def skp = execution.getVariable("SKP_doradcy_portfelowego")
def branchSkp = execution.getVariable("Oddział_zgłaszającego")

def dashboardParams = [
	"Application number"                : businessKey,
    "Selected leads"             : lead,
    "Customer CIF"               : cif,
    "Application submission time"     : time,
    "Completing SKP"        : modSkp,
    "Portfolio advisor SKP"  : skp,
    "Branch SKP"              : branchSkp,
	"Submitted leads"            : submittedLeads,
	"Rejected leads"            : rejectedLeads
]

searchString = businessKey + "," + 
               cif + "," + 
               time + "," + 
               modSkp + "," + 
               kp + "," + 
               branchSkp

execution.setVariable("PROCESS_DASHBOARD_DESCRIPTION", "Lead process")
execution.setVariable("PROCESS_DASHBOARD", dashboardParams)
execution.setVariable("SEARCH_STRING", searchString)
```

In the above example, searching will be possible, among others, by:

* application number,
* customer CIF,
* submission time,
* SKP identifiers.

The basic search filter is located in the upper left corner (the field with a "magnifying glass"). Example of filtering the case list by branch SKP number:

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2Fgit-blob-dd559e211193af27aac25f23adbfc8b7684cb439%2Ffiltrowanie-lista-spraw.png?alt=media" alt=""><figcaption><p>Figure 1. Filtering the case list</p></figcaption></figure>

For the filter to work correctly, the variable **SEARCH\_STRING** must be added to the process variables.

Filters are saved in the URL address, which makes it possible to share a link with set filters with other users and to change filters from the URL level.

## Advanced filtering

The advanced filtering functionality is marked with the symbol: ![Ikona filtra](https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2Fgit-blob-12df5692274a7e8891b5171bbcb3e3e66b9818be%2Ffiltr_zaawansowany-ikona.png?alt=media)

### Task list

Available filtering parameters:

* **Case status**
  * Filtering by the businessStatus variable.
  * Multiple-choice field.
  * The list of available values is controlled by the variable **FILTER\_TASK\_STATUSES**.
* **Person assigned to the task**

  Available options:

  * all tasks,
  * only my tasks,
  * only unassigned tasks,
  * tasks of selected users (search after minimum 3 characters, possibility to select multiple users).
* **Task creation date**
  * Ability to define a date range (from – to).
* **Case type**
  * Filtering by the variable **processDefinitionKey**.
  * Multiple-choice field.
  * The list of values is controlled by the variable **FILTER\_PROCESS\_TYPES**.
* **Case ID**
  * Filtering by the businessKey variable.
  * Searching works on the principle of the operator `LIKE`.

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2Fgit-blob-89843e6d98175b1613548fe5471425215fa6a108%2F2-filtr-zaawansowany-lista-zadan.png?alt=media" alt=""><figcaption><p>Figure 2. Advanced task list filter</p></figcaption></figure>

### Case list

Available filtering parameters:

* **Case status**
  * Filtering by the variable **businessStatus**.
  * Multiple-choice field.
  * The list of values is controlled by the variable **FILTER\_PROCESS\_STATUSES**.
* **Case type**
  * Filtering by the variable **processDefinitionKey**.
  * Multiple-choice field.
  * The list of values is controlled by the variable **FILTER\_PROCESS\_TYPES**.
* **Case ID**
  * Filtering by the variable **businessKey**.
  * Searching works on the principle of the operator `LIKE`.

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2Fgit-blob-9a7f7f5c84b8743f85f150047129bad7fc646983%2F2-filtr-zaawansowany-lista-spraw.png?alt=media" alt=""><figcaption><p>Figure 3. Advanced case list filter</p></figcaption></figure>
