Compute
Compute fields calculate values dynamically based on other fields in the same record. They're read-only and recalculate automatically when source fields change.
View all settings
| Setting | Description |
|---|---|
| Field Name | Text input, required. Unique identifier. |
| Input Type | Dropdown, required. The computation function to apply. |
| Display Label | Text input. Human-readable label shown in forms. |
| Sort Order | Number input, defaults to 0. Position in field lists. |
| Icon | Icon picker. Visual identifier. |
| Status | Toggle, defaults to true. Enable or disable the field. |
| Save to Database | Toggle, defaults to false. Persist the computed value. |
| Description | Text area. Documents the field's purpose. |
Input Types
Compute offers many calculation functions:
Math Operations
| Input Type | Description | Requires |
|---|---|---|
| Addition | Sum multiple fields | 2+ Fields, Scale |
| Subtraction | Subtract target from source | Source Field, Target Field, Scale |
| Multiplication | Multiply multiple fields | 2+ Fields, Scale |
| Division | Divide source by target | Source Field, Target Field, Scale |
| Modulo | Remainder of division | Source Field, Target Field |
| Absolute Value | Absolute value | Source Field, Scale |
| Round Number | Round to decimal places | Source Field |
String Operations
| Input Type | Description | Requires |
|---|---|---|
| Concatenate | Combine fields with pattern | 2+ Fields, Concat Pattern |
| Uppercase | Convert to uppercase | Source Field |
| Lowercase | Convert to lowercase | Source Field |
| Substring | Extract part of text | Source Field, Start Index, End Index |
| String Length | Count characters | Source Field |
Date Operations
| Input Type | Description | Requires |
|---|---|---|
| Add to Date | Add interval to date | Source Field, Interval Value, Interval Unit |
| Subtract Interval from Date | Subtract interval from date | Source Field, Interval Value, Interval Unit |
| Date Difference | Difference between dates | Source Field, Target Field |
| Current Timestamp | Current date/time | None |
| Age (Years) | Calculate age in years | Source Field |
| Full Age (Y/M/D) | Full age as years/months/days | Source Field |
| Extract Years | Extract years from date diff | Source Field |
| Extract Months | Extract months from date diff | Source Field |
| Extract Weeks | Extract weeks from date diff | Source Field |
| Extract Days | Extract days from date diff | Source Field |
Conditional Settings
Based on your selected Input Type, additional fields appear:
| Setting | Used By | Description |
|---|---|---|
| Source Field | Most operations | Primary field for computation |
| Target Field | Subtraction, Division, Modulo, Date Difference | Secondary field |
| Fields | Addition, Multiplication, Concatenate | Multiple fields (minimum 2) |
| Concat Pattern | Concatenate | Pattern using {fieldName} placeholders |
| Separator | String return types | Character between concatenated values |
| Scale | Math operations | Decimal places for result |
| Start Index | Substring | Starting position |
| End Index | Substring | Ending position (must be > Start Index) |
| Date Interval Value | Add to Date, Subtract Interval from Date | Amount of time |
| Date Interval Unit | Add to Date, Subtract Interval from Date | Unit: DAY, WEEK, MONTH, YEAR |
Advanced Settings
The Description text area lets you document the computation's purpose.
Query Filters
The Query Filters tab lets you add filter conditions to your computation:
| Setting | Description |
|---|---|
| Conjunction | First filter uses WHERE, subsequent filters use AND or OR. |
| Field | Select a field to filter on. |
| Operator | Comparison operator (is equal to, etc.). |
| Value | The value to compare against. |
Click Add Filter to add multiple conditions.
Use Cases
- Calculate order totals — Addition of line item prices
- Full name from parts — Concatenate
{firstName} {lastName} - Age from birthdate — Age (Years) with date field
- Inventory value — Multiplication of quantity × unit price
- Days until due — Date Difference between today and due date
Important Notes
- Compute fields are read-only — values cannot be manually edited
- Values recalculate automatically when source fields change
- Enable Save to Database if you need to query/sort by computed values
Related
- Common Settings — Shared settings reference
- Association — For aggregating related data
- Raw SQL — For complex PostgreSQL queries