Example: Dynamic Defaults Using Input Mapped Data

Note: This functionality is only available in Latest Version interviews.

You can derive a dynamic default value from an input mapped attribute, and also specify a default to use in the event that the input mapped attribute has no value. For example, if you had a screen collecting the location of the customer's store, you could:

  • specify that the input dynamically defaults to the customer's saved store (a mapped in value), and

  • specify that the input dynamically defaults to a static value if there is no value for the customer's saved store

To do this, you could have a rule like this:

A Word rule table used to determine the value that will be used to control a dynamic default value on an interview screen

Tip: If you wanted the customer's store to default to blank if there is no value for the customer's saved store, then you could have "" as the alternative conclusion in the rule table above.

You would then use "the dynamic default for the customer's store" as the dynamic default for "the customer's store" input on the screen.

The screen layout view on the Interview tab showing a dynamic default value setting

If the customer's saved store (mapped in) is Wellington, then when the screen is displayed, Wellington would be dynamically displayed as the default for the customer's store.

An interview screen that uses a mapped in value for the dynamic default for the customer's store

If the customer's saved store is Uncertain, then when the screen is displayed, Auckland would be dynamically displayed as the default for the customer's store.

An interview screen that uses a static value for the dynamic default for the customer's store when the mapped in attribute has no value

Tip: You can simulate what would happen with a data connection by testing this in the Debugger. On the Data tab, you would set a value for "the customer's saved store" and then you could see on the Interview tab that that value is defaulted for "the customer's store". To simulate what would happen when no value is mapped in, you would set "the customer's saved store" to Uncertain on the Data tab. Then on the Interview tab you could see that the default for "the customer's store" is determined by the value specified as the alternative conclusion in the table rule.

For more information, see Specify a Dynamic Default.