FunctionCopy link to clipboard
a!customFieldDefaultValue( value, default )
Used to create a real-time custom record field, this function returns a default value when the specified value is null or empty. All parameters must be of the same data type. When there are multiple default parameters, each parameter is evaluated in order and the first non-null or non-empty default will be returned.
ParametersCopy link to clipboard
Keyword | Type | Description |
---|---|---|
|
Any Type |
The record field or related record field to return if not null or empty. |
|
Any Type |
The record field, related record field, or literal value to return if not null or empty. This function accepts multiple default parameters, and each parameter will be evaluated in order until the first non-null and non-empty default is returned. |
Usage considerationsCopy link to clipboard
Where to use this functionCopy link to clipboard
The a!customFieldDefaultValue()
function can only be used to create a custom record field that evaluates in real time. This means you can reference related record fields, constants, and other supported functions in your calculations.
To create a custom record field that evaluates in real-time:
- In your record type, go to Data Model.
- Click NEW CUSTOM RECORD FIELD.
- From SELECT A TEMPLATE, choose Write Your Own Expression.
- Choose Real-time evaluation.
- Click NEXT.
-
Enter an expression using any Custom Field function.
Note: Custom record fields that evaluate in real-time must use at least one Custom Field function.
- Click NEXT.
- Enter a Name for your custom record field.
- Click CREATE.
- Click SAVE CHANGES. The new custom record field appears in your list of fields.
Supported data typesCopy link to clipboard
The value and default parameters can accept any of the following data types:
- Boolean
- Date
- Date and Time
- Time
- Number (Integer)
- Number (Decimal)
- Text
All parameters must be the same data type or compatible data types. Compatible data types include Number (Integer)/Number (Decimal) and Date/Date and Time.
For example, if you have a value of type Text, all default values should also be type Text. But, if you have a value of type Date, you could have default values of type Date or Date and Time.
ExamplesCopy link to clipboard
Let's say you have a createdOn
field in the Customer record type. If a customer has a null value for createdOn
, then you want to display the createdOn
field from the related record type Account instead. Using the a!customFieldDefaultValue()
function, you can create a real-time custom record field that does just that.
The expression would look something like this:
1
2
3
4
a!customFieldDefaultValue(
value: recordType!Customer.fields.createdOn,
default: recordType!Customer.relationships.accounts.fields.createdOn
)
Copy
See an example using this function with a!customFieldDateDiff().
Supported functionsCopy link to clipboard
You can use any of the following supported functions in the default parameter of a!customFieldDefaultValue()
. This allows you to use functions like today()
or now()
as a default value when the value parameter is null.
Note: When you use a supported function in a Custom Field function, you can only pass static values or constants containing static values into the supported function; you cannot pass record field references.
Feature compatibilityCopy link to clipboard
The table below lists this function's compatibility with various features in Appian.
Feature | Compatibility | Note |
---|---|---|
Portals | Partially compatible | Can be used with Appian Portals if it is connected using an integration and web API. |
Offline Mobile | Incompatible | |
Sync-Time Custom Record Fields | Incompatible | |
Real-Time Custom Record Fields | Compatible | Can only be used to create a custom record field that evaluates in real time. It cannot be used anywhere else in your application. |
Process Reports | Incompatible | Cannot be used to configure a process report. |
Process Events | Incompatible | Cannot be used to configure a process event node, such as a start event or timer event. |