Free cookie consent management tool by TermsFeed

a!customFieldCondition() Function

Function

a!customFieldCondition( field, operator, value )

Used in the whenTrue parameter of a!customFieldMatch(), this function allows you to create a condition.

Parameters

Keyword Type Description

field

Any Type

The record field, related record field, or custom field function to be compared in the condition. Use the recordType! domain to reference a record field or related record field. For example, recordType!Case.fields.caseName.

operator

Text

The operator used to compare the field and value parameters. Valid values: "=", "<>", ">", ">=", "<", "<=", "between", "in", "not in", "is null", "not null", "starts with", "not starts with", "ends with", "not ends with", "includes", "not includes".

value

Any Type

The value to compare to the given field using the given operator. This value must be a literal.

Usage considerations

Where to use this function

The a!customFieldCondition() 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.

Using the operator parameter

The following tables explains the behavior of each available operator:

Operator Description
= Equal to
<> Not equal to
< Less than
> Greater than
<= Less than or equal
>= Greater than or equal
in Matches a value in a list of values
not in Does not match a value in a list of values
starts with Begins with
not starts with Does not begin with
ends with Ends with
not ends with Does not end with
includes Includes the specified character(s)
not includes Does not include the specified character(s)
is null Is null
not null Is not null
between Is greater than or equal to a minimum value and less than or equal to a maximum value

Tip:  The between operator requires a list of two values, with the lower value as the first item and the upper value as the second. For example: {10,20}. You can set up one rule input or local variable that contains a list of two values, or create a list of two values in expression mode.

Tip:  Some databases can store empty text values as either null or as a zero-length string (usually described as ""). When querying against the Cloud Database using the is null operator on a text field, the result set will only return results that are explicitly set to null. In contrast, other databases may treat these zero-length strings as equivalent to null and thus return results for both null and empty values. Appian expressions do not distinguish between null and empty regardless of the underlying database. This means that when data is synced from a text field, values that were null or empty are both stored as null in the synced record type. Thus, when querying from a synced record type, the is null operator will then return values that were both null and empty in the database.

See Query Recipes for an example of how to use a!queryFilter() and a!queryLogicalExpression to query for both empty and null values.

The following table shows which operators can be applied to each data type.

Data Type Valid Operators
Text =, <>, in, not in, starts with, not starts with, ends with, not ends with, includes, not includes, is null, not null
Integer, Float, Time =, <>, >, >=, <, <=, between, in, not in, is null, not null
Date, Date and Time =, <>, >, >=, <, <=, between, in, not in, is null, not null
Boolean =, <>, in, not in, is null, not null

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) and Number (Decimal).

For example, if you have a field of type Text, then the value should also be type Text. But, if you have a field of type Number(Integer), you could have value of type Number (Decimal).

Example

See the a!customFieldMatch() function for an example.

Supported functions

You can also use any of the following supported functions in the value parameter of a!customFieldCondition():

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