Text selection variable options

Variable editor attributes: selection list items

This attribute is only pertinent for
text selection
variables.
There are a group of sub-attributes that collectively determine which selection options appear on the questionnaire:
  • Dynamic:
    options are specified statically or dynamically
  • Search Mode:
    searchable lists can use "begins with" or "contains" to match the text entered by the user
  • Unknown:
    the questionnaire user can explicitly state that the selection is unknown
  • Other:
    the questionnaire user can specify options that are not in the list
  • All:
    the questionnaire user can select all options with a single click
Attribute: Selection List Items
The Selection List Items section determines how individual options in a text selection are specified. There are two options and the Dynamic checkbox controls which of the options is selected as follows:
  1. Dynamic is unchecked:
    The text selection will be a static list of options
  2. Dynamic is checked:
    The text selection will be built dynamically from an expression such as a lookup expression
Static options
Static options are entered into the edit box on separate lines:
Default values are chosen by selecting an option and then clicking the
Toggle Default
button which will embolden the option and pre-select that answer on the questionnaire.
Dynamic options
Dynamic options are expressions which result in a list being created. They can be either:
  • entered manually in the edit box, or
  • clicking the corresponding
    Edit...
    button to the right of the edit box to invoke the expression editor
    .
For example, in the sample Non Disclosure Agreement, the OtherPartyCountry variable is a text selection whose text selection options are defined as a dynamic list. The expression is
Select Country
which instructs Contract Express to look for a lookup table containing a column called Country and present the options in the questionnaire from that lookup.
Attribute: Search Mode
Text Selection variables can have a Presentation Type of Searchable List. This results in the questionnaire presenting the user with a text box, but as the user types into the text box a dropdown pane will appear displaying text selections which match the text entered so far. The Search Mode attribute is displayed for Text Selections of this Presentation Type and defined how Contract Express will perform the search. The options are:
  • Begins With
    : Only items that start with the entered text will be displayed
  • Contains
    : Any item that contains the entered text will be displayed
Attribute: Show Unknown
When this sub-attribute is checked an additional option appears on the questionnaire which allows the user to explicitly state that the selection is unknown. This is useful if you do not want the text selection to be pre-filled with a default value. You can change the label for the unknown option from the default "select ..."
Attribute: Show Other
When this attribute is checked an additional option appears on the questionnaire which allows the user to enter an option or options that are not in the list of options.
This additional option is labeled
Other
(for english_uk and english_usa locales) which can be changed by entering the new label in the corresponding edit box to the right.
For example, consider a multi select checkboxes list of options representing communal areas in a leased property:
which is displayed on the questionnaire as:
Attribute: Show All
This sub-attribute is only pertinent for multi select presentation styles.
When this sub-attribute is checked an additional checkbox appears on the questionnaire which allows the user to choose all options with a single click
This additional checkbox is labeled
All
(for english_uk and english_usa locales) which can be changed by entering the new label in the corresponding edit box to the right.
For example, consider a multi select checkboxes list of options representing communal areas in a leased property:
which is displayed on the questionnaire as:

Building dynamic selections

Dynamic selections are used anytime we do not want to use static options for our lists. They can be built from other multi-select variables, repeat values, lookup table, database tables views or SharePoint lists.
Other multi-select variable answers
Consider a multi-select variable with product options:
We may then want to choose which Products are being sold with a support package using one text selection variable:
To do this we use the answer to the Product question as the
Options
for the Support question by entering it into the
Dynamic Selections
area for SupportPackage:
Repeats
We can also use Repeat values as the options for a text selection variable. Since text selections are filled with Lists, we need to build a list from our repeated values. We use the Collect function to do this. Let say we ask for one or more PartnerNames within a repeat span. Therefore our dynamic selections definition for the text selection variable EquityPartners becomes:
Collect(PartnerName)
Lookup tables
Columns from lookup tables can also be used to populate the options of text selections. In the dynamic selections area we use a select statement to refer to the column name, for example:
Select State
We can also display one column as the options seen on the questionnaire but have the value of the text selection come from another columns. This is useful if you want the user to choose the state but actually have the state code as the value for the variable:
Select Statecode, State
In the above example, the options on the questionnaire would be populated with state names such as Alabama, Alaska, Arizona etc but the value in the document would be AL, AK, AZ (useful for addresses)

External tables

Columns from database tables, views or SharePoint lists can also be used to populate the options on a text selection variable. These are very similar to working with lookups but you must add a FROM clause to the select statement to state the table name the lookup is to be performed on:
Select State From USStates
the automatic works as well:
Select Statecode, State From USStates
When data values actually reside in an external source, you must set up a link to that database by defining a Table in Contract Express.
Once the view has been created you can use Select statements such as those referred to above. You must always use a From clause.