Computed numeric and computed text fields (also called virtual fields) are database table field types that
use a script to auto-fill field values for each record.
Three examples of virtual field use are:
• computations such as creating a population density field using an existing population field and the polygon area standard attribute (POLYSTATS table).
• generating DataTips such as multi-line DataTips or DataTips that combine information from multiple fields.
• URL by attribute HyperLinks that combine the constant part of a URL with an attribute value to provide a unique link for a polygon or class of polygons, such as weather by ZIP code or property information by parcel ID.
Usually, the computed field expression accesses information in other fields (and attached elements) associated with that record to compute the new field value. The computed field expression is run for every record in the table containing it as it is needed when the table data is shown.
The simplest case is when your expression uses fields from within the same table as the computed field to get information from the same record.
It is also straight-forward when a computed field is added to an implied one-to-one table because there is always exactly one record for every element. Use a new or existing implied one-to-one table when you want a record (and field value computed) for every element.
However, when adding computed fields to other types of tables, the field will only be computed for existing records. You can still use element attachments to get records in other tables that are associated with the same elements.
Here is the syntax to access information in tables and fields:
• table.field - gets data from another field in the same record and table
• table[*].field - gets all records attached to element
• table[i].field - gets the ith record attached to element
• table[@*].field - gets all record in the table, attachment irrelevant
See the examples below to learn how to make computed fields with your own data.