Creates a field with the name of the parameter field setting its value to value. If the field already exists on an event the field keeps its existing value.

ParameterTypeRequiredDefault ValueDescription
fieldstring or arrayrequired   The field or fields to set the default value for. An array of multiple field names can be passed to this parameter.
replaceEmptybooleanoptional[a] false If the field's value is the empty string, override the value with the default.
value[b]stringrequired   Default value to assign to field, if not already set.

[a] Optional parameters use their default value unless explicitly set.

[b] The parameter name value can be omitted.

Hide omitted argument names for this function

Show omitted argument names for this function

default() Examples

Click + next to an example below to get the full details.

Set Default Values for Fields - Example 1

Set default values for field using the default() function so it can be used in a calculation with eval()

Set Default Values for Fields - Example 2

Set default values for field using the default() function so it can be used in a calculation with eval()

Set Default Values for Fields - Example 3

Set default values for a field and replace empty values with relevant default value