findMinIn2SForms( )
Find the minimum value of a given data item in all instances of the repeating section in a two-section form. This function works only for numeric fields.
For this function you can only use number-type questions. You cannot use drop-downs, radio buttons, or checkbox values as function parameters or as a target.
This is an aggregation function. The rule is run for each instance in the case where the target is on a repeating section of a two-section form.
Syntax
findMinIn2SForms(formInstance,'variable')
Parameters
Note:
It is allowed to reuse variables passed into this function elsewhere in the rule expression, however you must add the variable as a parameter using single quotes.Parameter | Required/Optional | Description |
---|---|---|
formInstance |
Optional | Indicates the form instance in which the search for
the minimum value is to be performed.
|
variable(s) |
Required | Item variable to check, passed in using single quotes. |
Return value
Numeric value that constitutes the minimum value across all instances or
"0"
if no minimum can be found.
Examples
Example 3-65 Find the minimum value of the "weight" number item across all repeating section instances in a two-section form in a visit
// Given 5 repeating section instances in a two-section form with "weight" item containing values of "150, 200, 250, 300, 350"
return findMinIn2SForms(null,'varWeight');
// returns 150
Parent topic: Two-section form functions