Click on Images to Expand Them
Choices Expressions are used to create selection lists (dropdowns, radio button lists, or choice buttons) with dynamically changing values. That means the list of options will be different depending on some condition. This condition can be based on a value selected in another field; permissions of the user; account owner's age; the number of listed beneficiaries; etc.
In the example below, options for Risk Tolerance will be restricted by the user's answer to the Is Income Your Account Investment Objective? question. The question will be a Checkbox Selection field with two pre-defined choices. The Risk Tolerance will be a Single Selection field that uses Choices Expressions and is displayed as a list of Radio Buttons.
To create such a dynamic field, you need to:
Create arrays that return the required data sets for the options that will be available for selection.
Define a function that chooses one of the arrays depending on the defined condition.
Create a Single Selection field with the "Use Choices Expression" setting selected.
In the Choices Expression setting, call the predefined JavaScript function.
In the example below, options for Risk Tolerance will be restricted by the user's answer to the Is Income Your Account Investment Objective? question. The question will be a Checkbox Selection field with two pre-defined choices. The Risk Tolerance will be a Single Selection field that uses Choices Expressions and is displayed as a list of Radio Buttons.
...
Step
...
Result
...
Step 1: Find Meta Field Names and Values.
This is important for mapping fields correctly to a PDF form.
Rw ui steps macro | ||
---|---|---|
Open a relevant document from a Client subfolder.
Turn on Admin Mode, by clicking the |
...
cog icon |
...
.
Hover your mouse over a field to see the meta field name and corresponding value. |
Meta Field Names and Values on a PDF form in Admin Mode
Step 2: Create a New Widget.
Rw ui steps macro | |
---|---|
Proceed to Administration menu > Single Pane of Glass tile > Widgets tile |
...
.
Create a new Dynamic Wizard widget. |
Step 3: Add a Load Action.
...
...
...
Field
...
Value
...
Virtual file name
...
dynamicDropdowns.js
...
Code
...
...
...
Step 4: Create a New Page
Rw ui steps macro | |
---|---|
Open the Pages tab |
...
.
Create a new page |
...
.
Add two fields to it. |
...
Step 5: Add a Checkbox Section Field.
Rw ui steps macro | ||
---|---|---|
o tOpen Add Field panel.
Add a Checkbox Section field to the page. Note: This first field will ask the user to answer the question: Is Income Your Account Investment Objective?
Enter the following values for the field settings: |
...
Adding a Checkbox Section field
...
Field
Value |
---|
...
Field Label
| This is the name of the field that is displayed to the user. |
...
...
Meta Field Name
| This is the unique name for the data held within the field as it will be referenced by other JavaScript code in the widget (the Choices Expressions function defined earlier) and mapped to respective fields in PDF forms. |
...
Initial value
| As "3" is the value for a deselected checkbox, then the checkbox will initially be |
...
deselected, but |
...
its value will not be NULL. |
...
...
Value for Checked
1 | This value will map to the corresponding "value" attributes of the meta field name in the PDF form |
...
if the checkbox is selected. |
...
...
Value for Not Checked
| This value will map to the corresponding "value" attributes of the meta field name in the PDF form |
...
if the checkbox is not selected. |
...
Step 6: Add a Single Selection Field.
Rw ui steps macro | |||
---|---|---|---|
Open Add Field panel.
Add a Single Selection field to the page. Note: This second field will show Risk Tolerance options, applicable to the selected investment objective.
Enter the following values for the field settings: |
...
Adding a Single Selection field
Field | Value |
---|
...
Field Label |
| This is the name of the field that is displayed above the list of options. |
...
Use label as placeholder | Selected |
...
Meta Field Name |
| This is the unique name for the data held within the field as it will be mapped to respective fields in PDF forms. |
...
Display Type | Radio List | The list of options will be displayed as radio buttons. |
...
Layout | Horizontal | The radio buttons will be displayed horizontally. |
...
Use choices expression | Selected |
...
Choices expression | This will call the |
...
|
...
Step 7: Apply Your Changes.
Rw ui steps macro | |
---|---|
Click the Apply button |
...
at the bottom of the screen to close the Widget Design Screen and apply changes. |
...
Click the Save button |
...
at the top of the Widget Details Screen to save these changes. |
...
Step 8: Test Your Widget.
Test the widget. For example, by selecting 'Is Income Your Account Investment Objective?' option in the wizard. Available options for the Risk Tolerance field should be reduced to two options 'Low' and 'Moderate'.
...
List of options changes based on a checkbox selection