FindDuplicateRepeatingForm( )
Detect duplicate data across repeating form instances for a given item. The data is identified by a form ID which has duplicate item values for the search keys provided. The rule target should be on the corresponding repeating section item.
Use as many arguments as needed to fully define the duplicate key.
- You cannot use drop-downs, radio buttons, or checkbox values as function parameters or as a target.
- If a variable is designed to hold a partial date, you must provide the value for that parameter in the same partial date format.
- Deleted instances are not matched unless the helper functions provides a parameter to include deleted records.
This is an aggregation function. The rule will run for each form instance in the case where the target is on a repeating form.
Syntax
FindDuplicateRepeatingForm('variable1', 'variable2',...)
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 |
---|---|---|
variable(s) |
Required | Item variable to check, passed in using single quotes. |
Return value
Boolean (true or false) value:
- True if duplicate values are found.
- False if duplicate values are not found.
Examples
Example 3-43 Check to see if any repeating form instances exist with the same values for Lab and Test Name
// Given 5 repeating form instances with items "Lab" and "Test Name"
if (FindDuplicateRepeatingForm('itmLab', 'itmTestName')) {
return false;
} else {
return true;
}
// Fires a query if more than 1 repeating form instance is found containing Lab = "Mass General" and Test Name = "CBC"
Parent topic: Repeating form functions