Free cookie consent management tool by TermsFeed

a!customFieldDefaultValue() Function

Function

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.

Parameters

Keyword Type Description

value

Any Type

The record field or related record field to return if not null or empty.

default

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 considerations

Where to use this function

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:

  1. In your record type, go to Data Model.
  2. Click NEW CUSTOM RECORD FIELD.
  3. From SELECT A TEMPLATE, choose Write Your Own Expression.
  4. Choose Real-time evaluation.
  5. Click NEXT.
  6. 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.

  7. Click NEXT.
  8. Enter a Name for your custom record field.
  9. Click CREATE.
  10. Click SAVE CHANGES. The new custom record field appears in your list of fields.

Supported data types

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.

Examples

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 functions

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 compatibility

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.

Feedback