Default Value Config
Default value config controls how a field receives an initial or recalculated value. It appears in the field creation and edit dialog for supported field types.
Default values are useful when a value can be prefilled from a fixed input, a related record, the current date, or a formula that reads other fields.
Default value config is not shown for Serial Number, Summary, Dynamic Formula, or Assist Text fields.
How To Use
- Open Field Design for a form
- Create or edit a supported field
- In Default Value, choose a mode
- Choose when the default value should apply
- Enter a literal value or formula expression
- Save the field
Modes
| Mode | Description |
|---|---|
| None | The field has no default value |
| Literal | Uses a fixed value selected or entered in the editor |
| Formula | Calculates the value from a formula expression |
Apply When
| Apply When | Description |
|---|---|
| On Create | Applies when a new record is created |
| Only When Empty | Applies only when the field is empty |
| On Dependency Change | Recalculates when dependent values change. This option is only available in Formula mode |
Literal Values
Literal mode uses an editor that matches the field type.
| Field Type | Literal Editor |
|---|---|
| Text, Long Text, Email, Link | Text input |
| Number | Number input |
| Switch | Switch state |
| Select, Radio | One configured option |
| Multi Select, Checkbox Group | One or more configured options |
| Search, Multi Search, Foreign Key | Record picker from the configured source form |
| Department, Organization | Structure picker |
| Date, Week, Month, Quarter, Year | Date picker |
| Datetime | Datetime picker |
| Time | Time picker |
| Array and Object data | Literal editor is not available yet. Use Formula mode or leave the default value empty |
Formula Mode
Formula mode calculates the default value from an expression.
| Tool | Description |
|---|---|
| Insert Function | Inserts a supported formula function into the expression |
| Insert Field | Inserts a field reference. Field references use FIELD("api_name") |
| Formula Expression | The expression that returns the default value |
| Preview | Shows how the expression is parsed |
| Formula Trial | Tests the formula with one record from the current form |
The formula result must match the target field data type. For example, a number field should return a number, and a boolean field should return a boolean.
Formula Functions
| Function | Usage | Description |
|---|---|---|
FIELD | FIELD("api_name") | Reads another field by API name |
IF | IF(condition, whenTrue, whenFalse) | Returns one of two values based on a boolean condition |
COALESCE | COALESCE(valueA, valueB, ...) | Returns the first non-empty value |
CONCAT | CONCAT(valueA, valueB, ...) | Concatenates multiple string values |
TRIM | TRIM(value) | Removes leading and trailing whitespace from a string |
REPLACE | REPLACE(value, "old", "new") | Replaces part of a string with another value |
SUBSTRING | SUBSTRING(value, start, length) | Returns a portion of a string |
LENGTH | LENGTH(value) | Returns the length of a string-like value |
NOW | NOW() | Returns the current datetime |
TODAY | TODAY() | Returns the current date |
FORMAT_DATE | FORMAT_DATE(value, "YYYY-MM-DD") | Formats a date or datetime value as text |
ADD_DAYS | ADD_DAYS(value, 1) | Adds or subtracts days from a date-like value |
ADD_HOURS | ADD_HOURS(value, 1) | Adds or subtracts hours from a datetime value |
ADD_MINUTES | ADD_MINUTES(value, 30) | Adds or subtracts minutes from a datetime or time value |
DATE_DIFF | DATE_DIFF(valueA, valueB, "days") | Returns the difference between two date-like values |
ROUND | ROUND(value, 2) | Rounds a numeric value to a fixed precision |
ABS | ABS(value) | Returns the absolute value of a number |
MIN | MIN(valueA, valueB, ...) | Returns the smallest numeric value |
MAX | MAX(valueA, valueB, ...) | Returns the largest numeric value |
FLOOR | FLOOR(value) | Rounds a number down to the nearest integer |
CEIL | CEIL(value) | Rounds a number up to the nearest integer |
TO_STRING | TO_STRING(value) | Converts a value to a string result |
TO_NUMBER | TO_NUMBER(value) | Converts a value to a numeric result |
TO_BOOLEAN | TO_BOOLEAN(value) | Converts a value to a boolean result |
UPPER | UPPER(value) | Converts a string result to uppercase |
LOWER | LOWER(value) | Converts a string result to lowercase |
IS_EMPTY | IS_EMPTY(value) | Checks whether a value is empty |
AND | AND(valueA, valueB, ...) | Returns true when every value is truthy |
OR | OR(valueA, valueB, ...) | Returns true when any value is truthy |
NOT | NOT(value) | Inverts a boolean value |
EQ | EQ(valueA, valueB) | Checks whether two values are equal |
GT | GT(valueA, valueB) | Checks whether the first value is greater than the second |
GTE | GTE(valueA, valueB) | Checks whether the first value is greater than or equal to the second |
LT | LT(valueA, valueB) | Checks whether the first value is less than the second |
LTE | LTE(valueA, valueB) | Checks whether the first value is less than or equal to the second |
UUID | UUID() | Returns a generated unique identifier string |
Formula Examples
| Scenario | Target Field Type | Formula |
|---|---|---|
| Build a display code with today's date | Text | CONCAT("NO-", FORMAT_DATE(TODAY(), "YYYYMMDD")) |
| Copy customer name when empty | Text | FIELD("so_customer_name") |
| Use fallback contact name | Text | COALESCE(FIELD("so_contact_name"), FIELD("so_customer_name")) |
| Calculate amount with tax | Number | ROUND(FIELD("so_amount") * 1.13, 2) |
| Keep a score inside a range | Number | MIN(MAX(FIELD("so_score"), 0), 100) |
| Check whether amount is high | Switch | GTE(FIELD("so_amount"), 10000) |
| Set due date after start date | Date | ADD_DAYS(FIELD("so_start_date"), 7) |
| Set reminder time after submit time | Datetime | ADD_HOURS(NOW(), 2) |
| Format a date as text | Text | FORMAT_DATE(FIELD("so_due_date"), "YYYY-MM-DD") |
| Generate a random token | Text | UUID() |
Validation
The formula editor checks common issues before the field is saved.
| Issue | Meaning |
|---|---|
| Missing parenthesis | Opening and closing parentheses must match |
| Unsupported function | The expression uses a function that is not in the supported function list |
| Self reference | A field cannot directly reference itself with FIELD("current_api_name") |
| Field not found | The referenced API name does not exist in the current form |
| Result type mismatch | The formula result type does not match the current field data type |
| Empty expression | Formula mode requires a formula expression |
Tips
| Tip | Description |
|---|---|
| Use Insert Field | It avoids typing the wrong API name |
| Match the field type | Text fields should return text, number fields should return numbers, and switch fields should return booleans |
| Use Formula Trial | Test the expression against a real record before saving |
| Use dependency recalculation carefully | On Dependency Change keeps values updated, but should be used when the field is meant to follow other fields |
| Keep expressions readable | Split complex logic into intermediate fields when one formula becomes too long |
Formula Validation In Commands
For formula defaults in system commands, set defaultValue.mode to formula and provide a non-empty defaultValue.formulaExpression. Empty expressions are rejected with FORMS_FIELD_FORMULA_EXPRESSION_REQUIRED.