A common question we get is how to allow an interview user to select multiple values for an attribute. A Global attribute may only have one value at a time, so one way to address this requirement, particularly when you only have a small number of list options, is to use multiple attributes. If the list of options is much longer, you could either use an inferred entity or entity instances collected on screen.
Let’s look at some worked examples.
Example 1. Using multiple Booleans
The simplest implementation is to use a label followed by checkboxes to select multiple Boolean attributes. This will have the appearance of allowing the user to select multiple values for an attribute but in reality is setting multiple attributes. An example of this is in the DMVDocGuide example project (available in Policy Modeling) where checkboxes for separate Boolean attributes (relating to name change documents) are preceded by a single label:
Example 2. Using multiple Booleans where the user needs to select 2 of 5 options
A more advanced example would be where you want to limit the number of Boolean options that the user can select. For example, where the user needs to present at least 2 identification documents from the list of 5 documents to satisfy ID requirements.
Here you could have a Boolean attribute for each of the 5 options:
as well as a corresponding number attribute for each Boolean:
Then you could have rules to set each number attribute to ‘1’ if the Boolean is selected and ‘0’ if the Boolean is not selected:
Another rule could be used to calculate the total of the number attribute values. This will equal the number of Booleans that were selected:
You could then infer that the person can establish proof of identity if they have provided the minimum number of identity documents (that is, 2):
An interview screen could ask which documents the person has presented (using a label) followed by checkboxes for each of the 5 Boolean attributes:
If the user selects 2 or more checkboxes, they will be deemed to have established proof of identity.
However, if they only select 1 (or none), then they will be deemed to have not established proof of identity.
To see how this project was implemented in more detail, download this example project.
Example 3. Using an inferred entity
When the list of options is much longer, instead of using multiple Booleans (as in Examples 1 and 2), you could instead use an inferred entity.
In this example, the person needs a minimum of 100 points of identification for an application, where different identification documents have different point values. An example of this is the Australian Federal Police 100 point checklist for identification documents. This example also classifies the different identification documents as Primary or Secondary where the person must provide at least one Primary form of identification.
Here you could use an inferred entity for ‘the identity document’:
with a relationship ‘the documents provided’:
And collect the relationship on the interview screen:
where the list options are defined in Excel as inferred instances:
This appears on screen as:
Additional conclusions can be added to your Excel rule table to determine the classification and the points value of the identify document:
You could then infer that the person has provided the minimum number of points of identification for the application if the total points value for all documents is at least 100:
You could use error rules to help the user make the right selections to meet the identification requirements. For example:
- To ensure the user has selected at least one option, you could have the following Word rules:
- To enforce that at least one of a particular type of document (Primary) must be selected, you could have the following Word rules:
- To ensure the user has provided at least 100 points of identification, you could have the following Word rule:
If the user selects a combination of identity documents whose points value is at least 100, then they will be deemed to have established proof of identity.
To see how this project was implemented in more detail, download this example project.
Example 4. Using entity instances collected on screen
Another alternative when you have a longer list of options is to use entity instances collected on screen.
This example is similar to Example 3, but in this case, the identity document instances are not inferred, but collected on screen. This allows the user to incrementally enter selections, and duplicate previous selections.
Here you would use a standard child entity for ‘the identity document’:
Then a screen could collect ‘the identity document’ entity instances:
which presents to the user as individual inputs:
Similar to Example 3, you could add an Excel rule that provides the identity document type and infers the points value and classification (Primary or Secondary) for each type. Note for this example ‘the identity document type’ is a condition that needs to match the list values presented to the user to select on-screen:
You could sum the total points of identification and show this value as a label on screen (the value will update automatically as the user changes their identity document selections).
Similarly to Example 3, rules can be added to validate the selections.
To see how this project was implemented in more detail, download this example project.
Example 5. Using an interview extension
Alternatively, if the styling you are going for is more of a multi-select fixed or drop-down list box, then you may like to write an interview extension to render the input control as a multi-select list box matching your corporate styling. For example:
Further information
If you would like further information on any of the concepts covered in this post, check out these topics in the Intelligent Advisor Documentation Library:
- Checkboxes
- Add a rule table in Word
- Prove multiple attributes for the same set of conditions
- Write an error event rule
- Define a screen for collecting members of a relationship
- Define a screen for collecting entity instances
- Add an entity-level attribute to an entity collect
- Use the values provided in the rules
Credits
Design by Fiona Guy, Jasmine Lee and Sue Novak