Dynamic Filtering - Lookup Lists
Dynamic Filtering allows Lookups to be filtered by values which are contained in another field on a form. This means that the values which are shown in a Lookup List will vary, depending on the value in another field.
To add a dynamic conditional filter to a lookup
- Create the Lookup Filter in designer Filters Lookup Filters
- For the [Field Type] select the field you are going to filter.
- Save
- Click on Add New for the Role Settings. Enter a Name and Description.
- Select the Visible Ids
Add the Condition To get the Form Field ID open the Form designer, and click on the wrench for the field that will form the condition (in this case [Have you spoken to the person]) and copy and paste the Field Element Id
Example
For an action we only want Low or Medium to show if the person assigned the action has not been spoken to.
Condition: [Have you spoken to this person] = No
<Condition lhs=".FORMFIELD_ABMg1BxuMzI0NDY5NjY0OTIz" op="EQ" rhs="0" type="int"/>
Whereas if the person knows about the action then you can select High or Urgent.
Condition: [Have you spoken to this person] = Yes
<Condition lhs=".FORMFIELD_ABMg1BxuMzI0NDY5NjY0OTIz" op="EQ" rhs="1" type="int"/>
- Add the filter to the field
To create a filter the condition MUST refer to the Form Field ID.
Rules:
- You cannot drill through to things that are not visible on the form.
- You can apply a filter on lookup fields which are displayed as a combobox (dropdown) or a single/multi select window (popup).
- It needs to be written in XML, there is no 'condition builder'.
Tip: Can use the condition builder in component security to build the basic condition - When selecting the visible lookups, a lookup item can be selected only once.
Additional filtering will work in the Web Application but not in Roam like the use of OR, AND or NOT in the condition.
Other Examples
Incident [Potential Severity] is determined by the selection of [Actual Severity]
|
XML
|
Condition
|
Visible
|
<Condition lhs=".FORMFIELD_AFBWkBchMjM2NDYzNzkyODEx" op="IN" rhs="9999999_1572,9999999_1573,9999999_1574" type="i18n"/>
|
When [Actual Severity] IN
Catastrophic, Major, Moderate
|
Show [Potential Severity] Catastrophic, Major, Moderate
|
<Condition lhs=".FORMFIELD_AFBWkBchMjM2NDYzNzkyODEx" op="IN" rhs="9999999_1575,9999999_1576,9999999_1571type="i18n"/>
|
When [Actual Severity] IN
Minor, Insignificant, Not Applicable
|
Show [Potential Severity] Minor, Insignificant
|
|
|
|
Filtering values in a subform based on a selection in the parent
[Action Priority] is determined by the selection of Incident [Actual Severity]
|
XML
|
Condition
|
Visible
|
<Condition lhs=".FORMFIELD_AFBWkBchMjM2NDYzNzkyODEx" op="IN" rhs="9999999_1572,9999999_1573" type="i18n"/>
|
When [Actual Severity] IN
Catastrophic, Major
|
Show [Action Priority] Urgent
|
<Condition lhs=".FORMFIELD_AFBWkBchMjM2NDYzNzkyODEx" op="IN" rhs="9999999_1574,9999999_1575" type="i18n"/>
|
When [Actual Severity] IN
Moderate, Minor
|
Show [Action Priority] High, Medium
|
<Condition lhs=".FORMFIELD_AFBWkBchMjM2NDYzNzkyODEx" op="IN" rhs="9999999_1576,9999999_1571" type="i18n"/>
|
When [Actual Severity] IN
Insignificant, Not Applicable
|
Show [Action Priority] Low
|
|