Use a Dynamic Label to Help the User Enter Valid Data

You can add a label to a screen that dynamically changes in text based on data on the same screen. These labels can appear wherever you want on the screen and can be formatted using the built-in label styles. This feature can be used to help a user understand how to enter valid data.

For example, on a screen collecting a person's desired allocation of funds across investment options (cash, shares, property, government bonds), a total percentage can be shown which is calculated and updated dynamically as the user enters values for their investment allocations.

A label on an interview screen showing a total percentage that is calculated based on answers to other questions on the same screen

A label on an interview screen showing a total percentage that is calculated based on answers to other questions on the same screen

To do this, there is a rule that calculates the total percentage of investments (the percentage allocated to cash + the percentage allocated to shares + the percentage allocated to property + the percentage allocated to government bonds). This attribute (total_investments_percentage) is substituted into the label on the screen to show the total (Total: %total_investments_percentage%%%). Note that double percentage signs are used to represent an actual percentage symbol in the label text.

In this example, the total percentage label could be used in conjunction with a label showing an error message that is displayed when the total percentage is not equal to 100%.

An interview screen showing an error message label that is displayed when the calculated total percentage is not 100%