list2SInstances( )

List all instance numbers for a two-section form.

This is an aggregation function. The rule is run for each form instance in the case where the target is on a two-section form.

Note:

This rule helper function is not supported for use in Screen Candidate rule execution.

Syntax

list2SInstances('variable', formInstance, includeDeleted)

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 or Optional Description
variable Required Item variable to search, passed in using single quotes.
formInstance Optional Indicates the form instance in which the search is to be performed.
  • If null, the search considers an array of existing instances of two-section forms. Ideally this should be used with variables in the flat section of the form.
  • If a value is provided, the search considers an array of existing table rows on the specified instance of the two-section form.
includeDeleted Optional Indicates whether deleted records are included in the output:
  • 0 - Do not include deleted Repeating instances in the return array. This is the default for when no value is provided.
  • 1 - Include deleted Repeating instances in the array count.

Return value

An array of two-section form instance numbers.

Examples

Example 3-75 Raise a query if AE form instance #2 does not exist

// Raise a query if AE form instance #2 does not exist
var arrAE = list2SInstances('onDate', 0);
return (arrAE.indexOf(2) == -1)?false:true;