How to Work with Filters and Orders

Filters and orders allow users to set specific criteria that displayed cards should match and their sorting.

Filters and orders are set and applied separately for each column. They can be stored as Kanban views and selected to be applied together for the whole dashboard.

Also they can be stored as Filter Templates suitable for future re-use (see below).

Configuring filters

Select Source in the picklist.

Source is a set of object fields allowed to select, and columns to apply these selections for. Source can be:

  • system - matches SObjects selected as data source for columns

  • custom - configured by dashboard administrator (see below)

When source is selected, the list of columns becomes containing columns that have this source as data source object. Select columns you want to add filters to by checking checkboxes; the filter you add now will be applied to these columns only.

After Source and columns have been selected, you need to set a filter criterion.

  • Select a Field. An "Operator" picklist will appear; its content will depend on Field selected.

  • Select necessary operator and set the Value in the proper field.

  • Click "Add" button to add filter criterion to selected columns:

Note: "Cancel" button will be shown only if you're adding not the first filter criterion.

User can add more filter criteria to different columns. After adding user is returned to Filters sidebar. Select column to see filter criteria set for it:

Now user can:

  • change filter criterion value (example: "Mechanical")

  • Clear all filters to show all records

  • Apply specified filter criteria to selected column

Order also can be edited or deleted on the Filters form.

If add more than one filter criteria to the same column, user gets possibility to combine them with logic operators. The proper form will appear. Set the logic (place filter criteria numbers in brackets):

Select columns with checkboxes and click "Confirm" button to apply changes and close popup.

Check that logic is suitable for all selected columns.

Apply filter criteria and sorting order to selected columns by clicking the "Apply" button.

User can save configured Filter for further usage as a View (see below).

Filters and orders that were not saved will be lost on page reload or clear.

Enter new Filter name and click "Save":

Check "Template?" checkbox if you want to save selected filter/sorting as a Template (see below) instead of applicable Filter.

New Filter will appear as a View at the Kanban Views Menu:

Now user can:

  • select this View to apply a set of filter criteria and sorting order quickly

  • edit filters, orders and save this View or save as another view (22)

  • make this View "default"

  • "delete" this View

Sharing filters (views)

Filters can be shared using standard Sales Force sharing mechanism.

Click "share" button in Filter menu:

To share filter with multiple users you can create a public group, add users to this group and use it as a source record of new sharing setting.

How to mark filter as default for users programatically

Below script can be used to mark filter as default for the list of users.

String data = '{"defaultView":"filterName"}'; // JSON string, replace 'filterName' with a name of filter that needs to be set as default

String kanbanId = 'kanbanId'; // id of Kanban filter belongs to

List<User> users = [select Id, Name from User where Name = 'System Admin' or Name = 'Test User']; // select users filter will be shared with

List<FLX_KB__KanBan_Config_Custom__c> configToInsert = new List<FLX_KB__KanBan_Config_Custom__c>();

for(User u : users)

{

configToInsert.add(new FLX_KB__KanBan_Config_Custom__c(FLX_KB__Assignee__c = u.id, FLX_KB__Data__c = data, FLX_KB__Source_ID__c = kanbanId, FLX_KB__Type__c = 'FiltersConfig'));

}

if(configToInsert.size() > 0) insert configToInsert;

Configure custom sources

Dashboard administrators can define their custom filter sources with restricted sets of fields. This can be useful in situations when it is not necessary to give user all object fields.

Open Kanban editor and click "create"("edit") link of "Config" at the right sidebar and go to "Filters Configuration" tab.

On the "Basic configuration" subtab:

  • specify the filter source Label (that will be shown in the sources picklist on the Kanban)

  • set filter source Name

  • select Source Type

If the source type is SObject, select the source object; available source objects are the same as were configured for the kanban columns.

Select Fields from the Source Object, that will be available for user to select in filters:

Go to "Availability Configuration" subtab and select columns which this source will be applicable for:

Save filter, filters configuration and kanban. Now when user opens filters and selects this custom source, he will be able to select fields and columns from restricted sets:

If the Source Type is Picklist or Static Text, administrator should configure some Apex properties. He should specify Title, select available Operators, choose Value and configure it:

Availability configuration is configured in the same way as for SObject Source filters.

Transmitting filters to other places

User can take filters currently applied to column(s) and pass them to other place where they are needed.

For example, we have a Kanban that shows Opportunities of some specific delivery/installation status in every column, and we want to show all entries related to each column in separate list. We do:

Create a form named "Opportunity form" with these elements:

  1. Variable of String type with this value: FORMULA[IF(ISBLANK({$FormParameters.filters}), '', ' and ' + {$FormParameters.filters})]

  2. List that has these properties:

    • Source Object: Opportunity

    • Conditions: DeliveryInstallationStatus__c = '{$FormParameters.dis}' {$Form.$Variables.filters}

  3. Add some static text which will contain {$Form.$Variables.filters} text - this will allow to see filter criteria actually passed to the form.

Create standard kanban, add 3 columns there. Columns should have these properties:

  • Data Source: Opportunity

  • Conditions: Delivery/Installation Status equals "In progress" / "Yet to begin" / "Completed" (different for each column)

Add a cell in each column header, with these properties:

  • Type: Text

  • Value: {$Column.Name}

  • Handler with these properties:

    • Type: Form

    • Value: Opportunity form

    • Open in: New Window

    • Parameters:

      • filters= {$Column.Filters}

      • dis = "In progress" / "Yet to begin" / "Completed" (different for each column)

      • mode = edit

Add a card to represent opportunities (with name, Delivery/Installation Status and Stage fields).

Save and open the newly created kanban. Click on filters sidebar and set some filters and filter logic:

Apply the filtering set.

Click on the header of the column which is affected by these filters. Form will be opened in the new tab and will show the full list of opportunities matching these criteria:

  • Delivery/Installation Status is equal to form handler parameter "dis"

  • Stage is matching the filters set (StageName = "Closed Won" OR StageName = "Qualification") - that was the purpose of this example:

Last updated