Different required and relevant conditions

In my form, there are optional questions related to certain measurements, but if the user enters a value for that measurement, then she is required to answer a follow-up question regarding the units of measure.

It’s easy enough to have the units question display only if a force value is entered, and then make that unit question required, as shown below in the truncated XLSX screenshot below, labeled “STANDARD”.

The problem is that this creates a headache for enumerators entering the data. The units question only appears after a force value is entered, and it interrupts the flow of data entry (e.g., hitting tab on the keyboard skips to the question beyond the units question). Better would be to have the unit questions appear every time the force questions appear, but only have the units question required if the user enters a force. An example of this logic is shown in the screenshot below, labeled “PROPOSED”

Is something like this possible?

Like relevant expressions, required expressions can also be calculations (ie not just true and false).

Try:

name required relevant
sample_hammer_force_units ${sample_hammered_force} != ‘’

Have a play around with the following form, which shows this dynamic required behavior:

SimpleForm copy.xlsx (18.2 KB)

3 Likes