Skip to main content

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​

  1. Open Field Design for a form
  2. Create or edit a supported field
  3. In Default Value, choose a mode
  4. Choose when the default value should apply
  5. Enter a literal value or formula expression
  6. Save the field

Modes​

ModeDescription
NoneThe field has no default value
LiteralUses a fixed value selected or entered in the editor
FormulaCalculates the value from a formula expression

Apply When​

Apply WhenDescription
On CreateApplies when a new record is created
Only When EmptyApplies only when the field is empty
On Dependency ChangeRecalculates 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 TypeLiteral Editor
Text, Long Text, Email, LinkText input
NumberNumber input
SwitchSwitch state
Select, RadioOne configured option
Multi Select, Checkbox GroupOne or more configured options
Search, Multi Search, Foreign KeyRecord picker from the configured source form
Department, OrganizationStructure picker
Date, Week, Month, Quarter, YearDate picker
DatetimeDatetime picker
TimeTime picker
Array and Object dataLiteral 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.

ToolDescription
Insert FunctionInserts a supported formula function into the expression
Insert FieldInserts a field reference. Field references use FIELD("api_name")
Formula ExpressionThe expression that returns the default value
PreviewShows how the expression is parsed
Formula TrialTests 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​

FunctionUsageDescription
FIELDFIELD("api_name")Reads another field by API name
IFIF(condition, whenTrue, whenFalse)Returns one of two values based on a boolean condition
COALESCECOALESCE(valueA, valueB, ...)Returns the first non-empty value
CONCATCONCAT(valueA, valueB, ...)Concatenates multiple string values
TRIMTRIM(value)Removes leading and trailing whitespace from a string
REPLACEREPLACE(value, "old", "new")Replaces part of a string with another value
SUBSTRINGSUBSTRING(value, start, length)Returns a portion of a string
LENGTHLENGTH(value)Returns the length of a string-like value
NOWNOW()Returns the current datetime
TODAYTODAY()Returns the current date
FORMAT_DATEFORMAT_DATE(value, "YYYY-MM-DD")Formats a date or datetime value as text
ADD_DAYSADD_DAYS(value, 1)Adds or subtracts days from a date-like value
ADD_HOURSADD_HOURS(value, 1)Adds or subtracts hours from a datetime value
ADD_MINUTESADD_MINUTES(value, 30)Adds or subtracts minutes from a datetime or time value
DATE_DIFFDATE_DIFF(valueA, valueB, "days")Returns the difference between two date-like values
ROUNDROUND(value, 2)Rounds a numeric value to a fixed precision
ABSABS(value)Returns the absolute value of a number
MINMIN(valueA, valueB, ...)Returns the smallest numeric value
MAXMAX(valueA, valueB, ...)Returns the largest numeric value
FLOORFLOOR(value)Rounds a number down to the nearest integer
CEILCEIL(value)Rounds a number up to the nearest integer
TO_STRINGTO_STRING(value)Converts a value to a string result
TO_NUMBERTO_NUMBER(value)Converts a value to a numeric result
TO_BOOLEANTO_BOOLEAN(value)Converts a value to a boolean result
UPPERUPPER(value)Converts a string result to uppercase
LOWERLOWER(value)Converts a string result to lowercase
IS_EMPTYIS_EMPTY(value)Checks whether a value is empty
ANDAND(valueA, valueB, ...)Returns true when every value is truthy
OROR(valueA, valueB, ...)Returns true when any value is truthy
NOTNOT(value)Inverts a boolean value
EQEQ(valueA, valueB)Checks whether two values are equal
GTGT(valueA, valueB)Checks whether the first value is greater than the second
GTEGTE(valueA, valueB)Checks whether the first value is greater than or equal to the second
LTLT(valueA, valueB)Checks whether the first value is less than the second
LTELTE(valueA, valueB)Checks whether the first value is less than or equal to the second
UUIDUUID()Returns a generated unique identifier string

Formula Examples​

ScenarioTarget Field TypeFormula
Build a display code with today's dateTextCONCAT("NO-", FORMAT_DATE(TODAY(), "YYYYMMDD"))
Copy customer name when emptyTextFIELD("so_customer_name")
Use fallback contact nameTextCOALESCE(FIELD("so_contact_name"), FIELD("so_customer_name"))
Calculate amount with taxNumberROUND(FIELD("so_amount") * 1.13, 2)
Keep a score inside a rangeNumberMIN(MAX(FIELD("so_score"), 0), 100)
Check whether amount is highSwitchGTE(FIELD("so_amount"), 10000)
Set due date after start dateDateADD_DAYS(FIELD("so_start_date"), 7)
Set reminder time after submit timeDatetimeADD_HOURS(NOW(), 2)
Format a date as textTextFORMAT_DATE(FIELD("so_due_date"), "YYYY-MM-DD")
Generate a random tokenTextUUID()

Validation​

The formula editor checks common issues before the field is saved.

IssueMeaning
Missing parenthesisOpening and closing parentheses must match
Unsupported functionThe expression uses a function that is not in the supported function list
Self referenceA field cannot directly reference itself with FIELD("current_api_name")
Field not foundThe referenced API name does not exist in the current form
Result type mismatchThe formula result type does not match the current field data type
Empty expressionFormula mode requires a formula expression

Tips​

TipDescription
Use Insert FieldIt avoids typing the wrong API name
Match the field typeText fields should return text, number fields should return numbers, and switch fields should return booleans
Use Formula TrialTest the expression against a real record before saving
Use dependency recalculation carefullyOn Dependency Change keeps values updated, but should be used when the field is meant to follow other fields
Keep expressions readableSplit 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.