Use Select option with Multiple Conditions and Fields
Imagine a Table component that displays data on sales opportunities. The sales reps using the page want to filter for three different things—represented by three different fields:
- Their assigned leads—the ones they "own" ( an OwnerID field )
- The records they have updated ( a LastModifiedById field )
- All records updated within a certain period, for example, "this month" ( a LastModifiedDate field )
Here's how to use multiple conditions to give users all these options on a single filter dropdown.
The goal? A filter that allows the user to select from a dropdown of pre-selected options to filter leads to display either:
- Those the user owns
- Those modified by the user
- Those modified within a specified time frame
Assumptions
-
a functioning model on an object that collects data on opportunities or leads. ( In this example, we use Salesforce's Opportunity object ).
-
a Table component that model with fields for:
- Name
- Amount
- Close Date and Last Modified Data
- Last Modified by ID and Owner ID
If using a different connection, the field names indicated may be different.
Create three separate conditions, one for each option.
-
Field: The field that records the record's owner: OwnerId
-
Operator: =
-
Value:
- Content: The Nintex Apps /Salesforce/Connection user attribute. (The correct option depends on the connection used.) This identifies the user accessing the data.
- User Attribute: User ID
-
State:
- Condition state: Dynamic (Default off). ( Nintex Apps will automatically generate a name for the filter.)
This filter is a little different, since it uses a datetime value.
-
Field: The field that records who modified the records: LastModifiedDate
-
Operator: =
-
Value:
- Content: Single specified value
- Value: Select the desired value from the picklist, for example, This Month, or This Week.
-
State:
- Condition state: Dynamic (Default off). ( Nintex Apps will automatically generate a name for the filter.)
On the Table component, click Add feature > Table filter, then configure the filter:
- Filter type: Select option
- Filter method: Server
- Pick options and condition: Manually
- Filter label: Sort my leads
- Model condition to affect: None
- Create "None Selected" option: Checked.
- "None Selected" option text: Sort by ...
- Display as: Dropdown.
Now, identify the sources for the filter's dropdown menu options. On the Choose amount filter, click
Add option source, then configure:- Source type: Manual
The filter needs three filter options (one representing each condition created in the first step).
On the Source: Manual option source, click
Add option, to create an option for the first item in the filter. Then configure:- Which conditions will this source's option affect?: Affect other conditions. You don't want to activate any default conditions, but instead activate one of those that you created specifically for this filter.
- Label: Owned by Me
Add effects to the option
Click
Add effect and configure:-
Action: Activate
Note: Do not use Activate and Set.
-
Model condition: The condition created earlier for the record owner.
Repeat the steps above to add two additional filter options and their effects:
- One with an option label of Modified by Me with an effect that activates the model condition about who modified the record.
- Another with an option label of Last Modified with an effect that activates the model condition about when the record was modified.