A Foreign Key Reference Field is designed to act as a "foreign key" to another form, facilitating data relationships and integrity within the system. Foreign Keys on a form represent a single record in another form table. A reference field on your form is a "Foreign Key" that holds the "Primary Key" of one record from another table.
An example of a Reference Field form.
The reference field provides the following capabilities:
In Form Designer you can add a reference field by dragging the reference field icon onto the form from the toolbar.
Double clicking a reference field in Form Designer will display the reference field's Properties, Security, and History.
In addition to the Default Field Properties Reference fields expose the following additional properties:
Other than the basic field security model Reference fields require that the user accessing the fields also have the appropriate access to the referenced form and field as well.
Details about field security are available here: Field Security
TODO: Link to the basic field history document that doens't exist yet (Probably nothing specific to reference fields here)
Details about field accessibility are available here: Accessibility
In order to set the value of a reference field in any script, set the value directly to the system_id of the record in the target table.
Example: $current.people_reference = "b34ec2ce-c4b9-b538-08dc-3384462e8b4b"
When you retrieve a record that contains a reference field there are several values returned immediately:
"displayValue": "John Doe",
"id": "b34ec2ce-c4b9-b538-08dc-3384462e8b4b",
"table": "people",
"url": "https://<your API Server>/api/table/people/b34ec2ce-c4b9-b538-08dc-3384462e8b4b"