Create a Toggle filter
A Toggle filter allows users to quickly switch a model condition on and off. This is useful when users need to switch between a filtered view and the complete set of records.
For example, a sales representative may manage accounts across multiple industries but primarily focus on the Technology industry. A Toggle filter allows the user to display only Technology accounts when needed and easily return to the full list of accounts.
Simple Toggle filter
Use a Toggle filter to turn on and off a model condition. For more information, see Filter Set.
Assumptions
The example below assumes a Nintex Apps page with:
-
A configured model connected to an object that stores account data. For example, the Salesforce Account object.
-
A Table component that displays account information, including account name, description, and industry.
If you are using a different data connection, the field names and objects may vary. For more information, see Connections.
The goal is to create a toggle filter that:
-
Displays only accounts from a selected industry when enabled.
-
Displays all accounts when disabled.
Note: A single Toggle filter can control multiple conditions across multiple fields. Add additional conditions and effects as required.
-
Open the model and add a model condition. For more information, see Manage conditions.
-
Configure the following:
-
Add field: Click to add the Industry field.
-
Operator: =
-
Content: Single specified value
-
Value: Technology or the required industry value.
-
Condition state: Dynamic
Nintex Apps automatically generates a condition name. Rename the condition if required for easier identification.
-
-
Click Save.
-
On the Table component, click Add feature > Table filter.
-
Configure the following:
-
Filter type: Toggle
-
Show label above the filter: Yes, use custom label
-
Filter label: Tech Accounts
-
Remember last-selected filter value: Enabled
For more information, see Component properties.
-
-
Click Save.
Add an effect to the filter
-
In the Properties panel, click the Effects tab.
-
Click Add effect.
-
Configure the following:
-
Action: Activate
This setting activates the selected model condition when users enable the Toggle filter. The condition is disabled by default, so enabling the filter applies the condition and updates the displayed records.
-
Model condition: Select the model condition created earlier. For more information, see Add model condition.
-
-
Click Save.
Toggle filter with subquery condition
A Toggle filter can also activate a condition based on related object data by using a subquery condition. For more information, see Create and configure a subquery condition.
For example, contacts may belong to accounts across multiple industries. A sales representative who focuses on Technology accounts may want to view only contacts associated with Technology accounts while still being able to return to the complete contact list.
A subquery condition allows Nintex Apps to filter records using fields from a related object.
The goal is to create a toggle that:
-
Displays contacts associated with accounts in the selected industry.
-
Returns to all contacts when disabled.
Assumptions
The example below assumes a Nintex Apps page with:
-
A configured model connected to a contact object. For example, the Salesforce Contact object.
-
A related Account object linked to the Contact object through the Account ID field.
-
Related Account fields added to the Contact model, including:
-
Account name
-
Industry
-
If you are using a different data connection, field names may vary. For more information, see Connections.
-
Open the model and add a model condition. For more information, see Manage conditions.
-
Configure the following:
-
Add field: Click to add the field on the Contact object that links contacts to accounts. For example, AccountID.
-
Operator: in
-
Content: Result of a subquery
-
Join object: Account
-
Join field: Id
-
Condition state: Dynamic
Nintex Apps automatically generates a condition name. Rename the condition if required for easier identification.
This condition links the contact record to its related account record. Nintex Apps uses this relationship to identify which contacts belong to accounts that match the filter criteria.
-
Add model subcondition
-
On the condition itself, click Add subquery condition.
-
Configure the following:
-
Add field: Click to add the Industry field from the Account object.
-
Operator: =
- Content: Single specified value
- Value: Technology or any industry you want to filter for.
- Condition state: Always on
-
- Click Save.
-
On the Table component, click Add feature > Table filter.
-
Configure the following:
-
Filter type: Toggle
-
Show label above the filter: Yes, use custom label
-
Filter label: Tech Accounts
-
Remember last-selected filter value: Enabled
For more information, see Component properties.
-
-
Click Save.
Add an effect to the filter
-
In the Properties panel, click the Effects tab.
-
Click Add effect.
-
Configure the following:
-
Action: Activate
-
Model condition: Select the model condition created earlier. For more information, see Add model condition.
-
-
Click Save.