Element specific filters

Set permanent filters on elements

Protobi spreadsheet view showing survey data with a column for question S1 asking about specialty type, displaying response categories like Practice Nurse, Hospital Nurse, etc., with corresponding count values and percentages in a crosstab format.

You can permanently limit elements to a given subset of respondents by applying the current scenario as a filter.

This is particularly useful to represent skip logic, where a question may apply only to a subset of respondents.

Example

For example this survey asks respondents for their specialty in S1. The survey has a skip pattern where S2 is only asked of respondents who answered "Practice Nurse" in S1. 

Protobi crosstab showing question S2 'What certifications do you hold?' with certification types listed as rows (Family Health, Child Health, etc.) and their corresponding response counts and percentages displayed in columns.

Define a filter

Press to filter for "Practice Nurse" in S1. This defines a scenario where the relevant subset of respondents is selected (see Press to query tutorial). 

Protobi interface showing question S1 with the 'Practice Nurse' response option highlighted or selected, indicating an active filter state that will limit the data view to only respondents who selected this category.

Apply permanent filters

With a scenario defined, we can apply the filter to S2 only. Press the edit icon for S2 and select "Filters..." from the context menu:

Context menu dropdown showing various editing options including 'Filters...' along with other menu items like Edit JSON, Insert element, Delete, Duplicate, Copy, Move, Sort elements, and Reorder options.

In the Filters dialog select "Apply current filters" and press Ok:

Filters dialog box with radio button options for filter management, showing 'Apply current filters' option selected, along with other options like 'No filter', 'Clear filters', and 'Edit filter expression', plus Ok and Cancel buttons at the bottom.

S2 is now permanently limited to Nurses, and this is automatically labeled in the footnote:

Protobi crosstab showing question S2 with certification data filtered to show only Practice Nurse respondents, with an automatic footnote at the bottom indicating the active filter condition.

The element filter is applied in addition to global and current filters that you've set in the project.  

Filters applied to a group are recursively set for child elements within the group.

You can override the automatic footnote by editing it.  Pressing on it once to make it editable and type preferred text.

Clear filters

To clear a filter, select "Clear filters" from the Filters dialog.

Editing the filter in JSON

Filters can be also be edited using the "Edit JSON..." option in the context menu.  This can be useful for advanced cases.

For example, the above S2 filter will have the "filter" attribute set using the MongoDB logic.

JSON Editor dialog showing the element configuration with a 'filter' property containing MongoDB query syntax, specifically filtering for S1 equals 'Practice Nurse', along with other element properties like name, label, and type.

Copy the filter to another element

You can highlight the entire filter attribute and copy it into the JSON Editor for other elements that follows the same skip pattern.