Conditional Filters can be defined on a Form Definition to render fields and tabs only when a the filter is met.
A Conditional Filter includes the following fields along with their purpose:
- Name – The name of the conditional filter.
- Field – The name of the XML element on a field that will be used to test.
- Test – The type of test to be performed on the Field and Value fields (Equals, greater than, etc.).
- Value – The value that Field will be tested against.
Conditional Filters let you provide a tailored user experience for a Form when you only want to display specific tabs and fields under special conditions.
A Concept Form should be used to display all the common features of every record of a Concept. For example, a Concept Form for an insurance policy management system would be an insurance policy. The Insurance Policy Concept Form would define all the common functionality of an insurance policy. This would include fields such as Policy ID, Effective Date, and other fields that any policy would need. An insurance policy may also have common state transitions, workflow, reports, and documents.
However, there are many different types of insurance policies that may require extra fields or workflow. For example, auto insurance, small business insurance, or property insurance. We could create separate Concept Forms for each of these insurance policy types but that can lead to a complex user experience and duplication of common code. A better approach is to use Conditional Filters on specific tabs and fields.
To achieve this you’ll first need a field that contains a list of Insurance Types on the form. Secondly, create a Conditional Filter for each Insurance Type (Auto, Small Business, Property, etc.) and input the name of the XML Element of the Insurance Type field into the Field textbox when creating the Conditional Filter. Lastly, create all the fields and tabs for the different insurance types and specify which conditional filter should be applied to the field/tab your creating.
Now when the Insurance Type is updated only fields and tabs with that Conditional Filter applied to them will be visible.
Previous article: Creating Form Definitions using trellispark UX Creator
Next article: Creating an Application Form Definition