Both the Form Details screen and the Schedule Type Edit screen allow for specifying a Summary Description formula. This page describes how to configure this field.
Editing the Summary Description Formula
This field allows the user to specify a formula that will dynamically populate the "Summary" field on the Program Components tab wherever the component form is used (for example, on the Site Details > Program Components list page). There are three options for configuring this field:
Option #1: Leave field blank
If the Summary Description Field is left blank, then the system will automatically populate the field by displaying the first field label and value on the form. For example, if the first field on the form is "Tank ID" and the value of that field on a particular form is "T-02", the Summary field will display "Tank ID: T-02". Note that this option does not support grid controls. So if the first field on a form is a grid control (i.e., a table), one of the two options listed below should be used instead.
Option #2: Specify a basic custom formula
This option allows the user to create a simple formula consisting of (1) one or more text strings; (2) one or more tags corresponding to fields on the component form; or (3) a combination of both. For example, the user can specify a formula of Outfall ID: `OUTFALL_ID`; Outfall Type: `OUTFALL_TYPE`. Assuming the form contains fields with the tags OUTFALL and OUTFALL_TYPE, containing values of "001" and "Pipe", respectively, this formula would populate the Summary field as follows: "Outfall ID: 001; Outfall Type: Pipe". Note that, to use this formula, text strings should be entered exactly as they should appear, while references to tags should be wrapped in backtick ( ` ) characters.
Option #3: Specify an advanced custom formula
To take advantage of the powerful formula builder available within the nFORM form designer, users can create a formula within a hidden field on the component form and then reference the tag of that field in the Summary Description Formula field. For example, suppose the user would like the Summary field to display a count of all the rows in the Pollutants table on the component form. The basic formula builder described in #2 above does not support aggregate functions like Count(), but the nFORM form builder does. So the user could do the following:
Add a Calculated control to the program component form and check the "Hidden" checkbox. (Or, if the user would like the control to appear on the form, it can be left visible.) For the purposes of this example, assume the user specifies a tag of "POLL_COUNT" for this control.
Add the necessary formula to the control to count the rows in the Pollutants table. For example, this formula counts all the rows in the POLLUTANTS table where the POLLUTANT field is not null: count(lookup(`AIR_POLLUTANTS`.POLLUTANT!=null,`AIR_POLLUTANTS`.POLLUTANT)). Publish the revised form.
Back on the Edit Component Type page, in the Summary Description Formula field, reference the new Calculated control, such as: Number of pollutants: `POLL_COUNT`. If there are three rows in the POLLUTANTS table, this will display "Number of pollutants: 3" in the Summary field on the Program Components list page.