When a value must always be entered for a form input control, the Validate Required checkbox must be selected as shown below for a standard text box:
However, when a value is only required under certain conditions, then this checkbox can NOT be used. This also applies to the setting of this checkbox for hidden inputs.
In order for an input to be conditionally required, e.g. when another selection input on the form has a specific value or set of values, then instead a condition must be specified in the Rule Validation rule.
The expression must be written such that a null value is returned only when a value is not required, and conversely a suitable text message unambiguously indicating which input on the form requires a value under exactly what conditions.
The following is an example of an expression which forces a user to specify a value for capacity for an Exchange Resource of a certain type. In this case an Autocomplete input with possible select values of Room or Equipment was used, of which only type "Room" required a capacity to be specified:
If(
And(Data.General.exchangeResourceType == "Room", Not(Data.General.capacity)),
"Capacity is required for rooms",
null
)
Comments
0 comments
Please sign in to leave a comment.