Skip to main content

WorkView Cascading Dataset component

The WorkView Cascading Dataset Form Component allows options from multiple chained (i.e. parent-child) WorkView Datasets to be presented to the user to select from, during a form submission. For example, if you wish to capture a location, you may ask for selection from a list of countries, then based on the selected country, ask for selection from regions in that country, followed by a selection from towns/cities in that region. There can be any number of Datasets in the chain, and it is not necessary for every option in a parent dataset to have related options in its child dataset.

tip

Each Dataset in the chain must be used by an Attribute of the selected WorkView Class, in order for it to be used within the form.

Settings

When adding the component to a page template, the following settings will need to be configured:

NameDescription
ApplicationThe WorkView Application in which the Datasets are used
ClassThe WorkView Class in which the Datasets are used
AttributeThe WorkView Attribute which uses the lowest level Dataset (in the example given above, that would be the Dataset listing towns/cities)
Top Level DataSetThe Dataset from which the user will be prompted to make their first selection (in the example given above, that would be the Dataset listing countries)
RequiredDoes the question have to be answered? If enabled, the user must select an option at every level for which there are options available
Help textText displayed under the field to guide the customer as to what they should choose
Show internallyIf enabled, this question will be shown on internal forms
Show publiclyIf enabled, this question will be shown on online forms

For each Dataset in the chain, the following settings are available:

NameDescription
Question textThe label used for the individual dropdown list
Include empty optionIf enabled, allows you to configure the text for an option which denotes no selection e.g. Please choose...
Help textText displayed under the individual dropdown list to guide the customer as to what they should choose
Set input purposeSet an input purpose to assist browsers in autofilling the question. See Setting the input purpose of a question for more information on this setting

Component behavior

The component will display the dropdowns in the order that they should be answered, and hide any that cannot yet be answered (as they rely on a parent value being selected).

Once an answer has been selected at a given level, the relevant options will be loaded for the next dropdown list, which will then be displayed.

If there are no options at the next level dependent on the value selected (or there is an error fetching them), subsequent levels will not be displayed, and the user's response to that question will be considered complete.

If the top level Dataset contains no values, the component will present a single option to the user: "My answer is not listed" with a value of [none]. If there is an error fetching the values from the top level Dataset, the component will present a single option to the user: "My answer is not listed" with a value of [error].

Return values.

The component will provide a form variable holding the selected answer for each level, the name of this variable is the label given to the dropdown list for that level.

Variables provided by the "WorkView Cascading Dataset" Component

If there are no options available at a given level, the value of the form variable will be [none]. If there is an error fetching options at a given level, the vale of the form variable will be [error]. It is important that you use branching and/or logic to handle these scenarios appropriately.

Values returned by the "WorkView Cascading Dataset" Component

A "Label" form variable is also provided, which holds a comma separated list of all answers.