Toggle menu

Filtering in Self Service and User Requests

The Self Service and User Request article extras let you build filters to control what each template displays.

Select the Processes to Display

Process Picker
 

In both Self Service and User Requests, this list box displays all of the currently deployed process models in the workflow engine. Select the processes you'd like to appear on your article. You can use Ctrl-Click or Shift-Click to select more than one. If you don't select any none will appear.

The Self Service template looks up the selected processes in the platform's search engine. User Requests looks up the history record of the selected process.

User Requests - Display Requests with the following "Label A" Values

Rather than selecting processes using the list box, in User Requests you can enter a comma separated list of history "labela" values. Histories with these labels will then appear as cards. These requests are shown in addition to those selected form the list box, they do not filter the selection.

This means it's possible to display history entries for records that are not related to workflow processes. For example, you might have forms that include a "History Write Event" action field.

Requests and History Labels
The cards that appear on the User Requests template come from iCM's History Service. Following our conventions for Labelc Histories and Reporting Data, a single request may have more than one history associated with it. For this reason the User Requests template excludes any histories that have labelc/d/e values to avoid duplicate cards appearing.

Filter Expressions

As well as selecting which processes or histories should be displayed, you can also set up the template to only return records that have certain values.

The filter expression block lets you construct an expression using ANDs or ORs with named fields and values. You can use = and != (equals and not equals) and brackets in your filters too. This filtering is applied to the processes/histories selected in the controls described above (ie it displays a subset of those histories or processes).

For example, you could select the "case management" process, and then write an expression to only show cases of a certain type.

This expression would only return processes that have a casetype of complaint or a casetype of feedback:

Filter - OR
 

This expression would only return complaints that also have an escalated status:

Filter - AND
 

Filter Expression Format

Before you can write expressions, you'll need to know the fields and possible values you want to filter on.

User Requests queries data stored stored by the platform's history service, so you'll need to be familiar with the structure and conventions used when writing histories. The Introduction and Key Concepts of the History worker is a good place to start. The filters you write are applied to the events in a history - it's not possible to filter on top level properties or the history subject.

Self Service queries workflow process data that has been indexed by the platform's search engine. Your filters will target named process variables, usually prefixed form_.

Expressions have the basic format of property = value where property is the name of a process variable (in Self Service) or nested property of a history event (in User Requests). In User Requests you can use dot notation to access nested properties. != (not equals) can be used to exclude items from your filters.

Expressions can be combined using AND or OR. AND means both expressions must evaluate as true for the record to be returned, OR means either can be true.

You can also use brackets to construct more complex filters.

Example Filters

This filter in User Requests would only return Case Management complaint cases:

formData.data.CASETYPE = 'Complaint'

Or in Self Service:

form_CASETYPE = 'Complaint'

This would return two case types:

formData.data.CASETYPE = 'Complaint' OR formData.data.CASETYPE = 'Garden Waste' 

Using brackets you can combine AND and OR expressions, this time returning two case types but only those that are escalated:

(form_CASETYPE = 'Complaint' OR form_CASETYPE = 'Garden Waste') AND form_STATUS= 'Escalated'

The not equals operator will return everything that doesn't match the expression:

formData.data.CASETYPE != 'Complaint'

Useful Case Management Filters

These are some of the common filters you might like to use.

VariableExampleDescription
caseEscalatedcaseescalated = "yes"This flag is set as "yes" once a case has been escalated, otherwise "no"
form_CASETYPEform_casetype = "complaint"Show cases of this type type
form_CASESTAGENAMEform_casestagename = "stage 1"Show cases at this stage
form_STATUSform_status = "under review"Show cases with this status
form_CASESUBTYPEform_casesubtype = "corporate"Show cases with this subtype
taskListTodotasklisttodo = "0"Show cases that have zero tasks (the task list will be zero if all tasks have been completed)

Self Service - Front End Filters

Once the template has been set up to only show tasks for the process instances you want, you can build filters that will appear in a drop-down on the article when someone is viewing all tasks.

Simple Filters

Start by building some simple filters. This example shows Self Service set up to work with Case Management. Each filter will display one case type:

Simple Filters
 

Each item in the list has a display value and an expression:

Filter Display and Expression
 

Which has generated the following drop-down options:

Simple Filter Drop-down
 

Creating Multiple Filters at Once

To make adding multiple items easier, press the "Add multiple" button. This lets you enter the name of a single process variable, then a comma separated list of possible values:

Add Multiple
 

Which will automatically generate the following list of items:

Add Multiple Result
 

You can then edit each item individually to tidy up the display values.

Last modified on May 07, 2024

Share this page

Facebook icon Twitter icon email icon

Print

print icon