Using Calculated Fields
Understanding Calculated Fields
Within the Quik! Field Definition, several fields exist to make it easier to fill forms and satisfy form fields that combine multiple pieces of information (e.g. when a form asks for an owner name, the calculated field called "FullName" is used, which is comprised of the owner's first name, middle name and last name). Calculated fields add a level of complexity when trying to pre-fill and/or process submitted form data.
- When prefilling data into fields, calculated fields cannot be prefilled (e.g. set value), but the resulting value can be retrieved (e.g. get value). In other words, fields should be mapped individually as any other field would be. Simply let the calculated fields function "do its job" to combine each field when the form is generated by a user.
- When processing data that is submitted from a form, the data may be coming from either a calculated field (e.g. FullName) or from a non-calculated field (e.g. First Name, Last Name), and in some cases from both fields at the same time. It is best to look at both the non-calculated fields and the calculated fields for values.
Quik! Calculated Fields Types
Quik! supports both name-based and address-based calculated fields. Both types of fields are structured with roles and "sub-fields" consisting of level 2 and/or level 3 base fields. For more information on the various levels of base fields as well as a complete list of base fields, please refer to the Quik! Field Definition Reference Guide.
Name-Based Calculated Fields
All name-based calculated fields consist of client roles (i.e. owner, osj, etc.), as well as one level of "sub-fields". Name-based calculated fields can include a contact's first name, middle name, last name, and suffix.
All name-based calculated fields are listed below. Note that this table does not include the role part of a calculated field.
Calculated Field | Description | Sub-fields and format (including punctuation) |
---|---|---|
FullName | The full name of a given contact role | FName MName LName, Suffix |
FullNameRev | The full name of a given contact role, displayed in reverse (last name listed first) | LName, FName MName Suffix |
Address-Based Calculated Fields
Address-based calculated fields are slightly more complex as they consist of a role as well as two levels of "sub-fields". Level 2 base fields are types of addresses (office, home, etc.). Level 3 base fields are the address data themselves (street, city, etc.).
All address-based calculated fields are listed below. Note that this table does not include either the role or level 2 base field parts of a calculated field. The total number of possible Calculated Fields is equal to these 5 listed, times the total number of relevant level 2 base fields, times the total number of relevant roles (i.e. client roles).
Calculated Field | Description | Sub-fields and format (including punctuation) |
---|---|---|
CityState | City & State combined together | City, State |
CityStateZip | City State & Zip code combined together | City, State Zip |
Addr123 | Address (all lines) | Addr1, Addr2, Addr3 |
Addr1234 | Address (all lines plus suite) | Addr1, Addr2, Addr3, Addr4 |
FullAddr | All address lines combined together | Addr1, Addr2, Addr3, Addr4, City, State Zip |
Enabling or Disabling The Calculated Fields Popup Feature
By default, this feature is enabled in all versions of the Quik! Forms Engine v5.3 and above. However, its property can be modified based on your need.
This can be done by setting the property ShowCalculatedFieldsPopup to False or True. (True is the default state).
Please see the Quik Form Viewer properties list in the Quik! Forms Engine Properties page for more details.
Enabling or Disabling The Calculated Fields Concatenation Feature
By default, calculated fields are enabled in all versions of the Quik! Forms Engine v5.3 and above for both name-based and address-based calculated fields. However, its property can be modified based on your need, on a field-by-field basis.
The only way for a calculated field to not calculate is to turn off the calculation for that specific field. In other words, you need to send the FieldCalcOverride set to true for the calculated field.
There are three ways to do turn off calculated fields (JSON for REST shown below).
By Form Field (see AddFieldToForm Method)
You can do it explicitly on the calculated field by setting the field name and just the FieldCalcOverride to true:
"FormFields": [
{
"FieldName": "1own.FullName",
"FieldCalcOverride": true
}
],
By Role (see SetFieldPropertyByRole Method)
You can also set the field calculation on an entire role instead of by field name:
"BulkFieldPropertiesByRole": [
{
"RoleName": "own",
"FieldCalcOverride": true
}
],
By Base Field Name (see SetFieldPropertyByFieldName Method)
You can also set the field calculation in bulk without setting a field value, and by “bulk” this means by the base field name without the role so this property is setting all fields that contain “FullName” in it:
"BulkFieldPropertiesByFieldName": [
{
"FieldName": "FullName",
"FieldCalcOverride": true
}
],
You likely want to turn off the calculated field popup too by setting ShowCalculatedFieldPopups = False.
Please see the FormField Parameters in the AddFieldToForm Method page for more details.
For help regarding Quik! Forms and the Quik! API
Email: support@quikforms.com | Phone: (877) 456-QUIK