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:

A label with individual Boolean attributes in an interview

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:

A Boolean attribute for each of 5 options in Policy Modeling

as well as a corresponding number attribute for each Boolean:

A number attribute corresponding to each of 5 Boolean options in Policy Modeling

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:

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:

A rule used to calculate the total of the number attribute values

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):

A rule that infers 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:

An interview screen using a label following by checkboxes for each of 5 Booleans

If the user selects 2 or more checkboxes, they will be deemed to have established proof of identity.

An interview screen asking which documents the person has presented (using a label) followed by checkboxes for each of the 5 Boolean attributes

An interviews screen showing that the user has established proof of identity

However, if they only select 1 (or none), then they will be deemed to have not established proof of identity.

An interview screen showing that the user has 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’:

An inferred entity for 'the identity document' in Policy Modeling

with a relationship ‘the documents provided’:

A relationship 'the documents provided' in Policy Modeling

And collect the relationship on the interview screen:

A relationship collect for 'the documents provided' in Policy Modeling

where the list options are defined in Excel as inferred instances:

An Excel rule where the list options for the identity document are defined

This appears on screen as:

Inferred instance options on an interview screen

Additional conclusions can be added to your Excel rule table to determine the classification and the points value of the identify document:

Additional conclusions in an Excel rule table used 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:

Rules that 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:
    Rules used to ensure the user has selected at least one option
  • To enforce that at least one of a particular type of document (Primary) must be selected, you could have the following Word rules:
    Rules used to enforce that at least one of a particular type of document (Primary) must be selected
  • To ensure the user has provided at least 100 points of identification, you could have the following Word rule:
    A rule used to ensure the user has provided at least 100 points of identification

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.

An interview screen showing 3 identity documents selected

An interview screen showing that the minimum number of points of identification have been provided

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’:

A standard child entity for 'the identity document' in Policy Modeling

Then a screen could collect ‘the identity document’ entity instances:

A screen collecting 'the identity document' entity instance in Policy Modeling

which presents to the user as individual inputs:

Entity instances presented on an interview screen 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:

An Excel rule showing 'the identity document type' as a condition

The list values for the attribute 'the identity document type' in Policy Modeling

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).

A Word rule that sums the points of identification

Similarly to Example 3, rules can be added to validate the selections.  

A Word rule used to validate that at least 100 points of identification has been provided

An error shown on an interview screen when 100 points of identification have not been provided

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:

A multi-select fixed list in an interview

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:

Credits

Design by Fiona Guy, Jasmine Lee and Sue Novak