FunctionCopy link to clipboard
a!customFieldSum( value )
Used to create a real-time custom record field, this function returns a sum of values. You can calculate the sum of record fields, related record fields, or literal values of type Number (Integer) or Number (Decimal).
ParametersCopy link to clipboard
Keyword | Type | Description |
---|---|---|
|
Any Type |
An array containing any combination of record fields, related record fields, or literal values to be summed. You must have at least two values in the array. |
Usage considerationsCopy link to clipboard
Where to use this functionCopy link to clipboard
The a!customFieldSum()
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.
Use with other Custom Field functionsCopy link to clipboard
You can use the a!customFieldSum()
function in conjunction with other Custom Field functions, like a!customFieldSubtract(), a!customFieldDivide(), or a!customFieldMultiply() to create the calculations you need.
See the Real-time evaluation recipes for an example.
ExampleCopy link to clipboard
Let's say you want calculate each employee's total salary, which includes their base salary, restricted stock units (RSU), and an annual bonus that is only applied if they qualify.
On the Employee record type, you could create a custom record field that evaluates in real-time so you can add the baseSalary
field, the related record field rsuDollarAmount
, and the related record field annualBonus
. However, the annualBonus
field will only be included in the calculation when the constant cons!DISCRETIONARY_BONUS
is true.
1
2
3
4
5
6
7
8
9
10
11
a!customFieldSum(
value: {
recordType!Employee.fields.baseSalary,
recordType!Employee.relationships.employeeLevel.fields.rsuDollarAmount,
/* If the constant is true, then add a discretionary bonus */
if(cons!DISCRETIONARY_BONUS,
recordType!Employee.relationships.employeeLevel.fields.annualBonus,
0
)
}
)
Copy
Supported functionsCopy link to clipboard
You can use any of the following supported functions in the value parameter of a!customFieldSum()
. However, you must reference at least one record field, related record field, or another Custom Field function in the value parameter.
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. |