Free cookie consent management tool by TermsFeed

a!customFieldDivide() Function

Function

a!customFieldDivide( numerator, denominator )

Used to create a real-time custom record field, this function returns the results of dividing two numbers. You can use record fields, related record fields, or literal values of type Number (Integer) or Number (Decimal) in your calculation.

Parameters

Keyword Type Description

numerator

Any Type

The record field, related record field, or literal value to divide.

denominator

Any Type

The record field, related record field, or literal value by which the numerator is divided.

Usage considerations

Where to use this function

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

Use with other Custom Field functions

You can use the a!customFieldDivide() function in conjunction with other Custom Field functions, like a!customFieldSubtract(), a!customFieldSum(), or a!customFieldMultiply() to create the calculations you need.

See the example below to see how you can use the a!customFieldDivide() and a!customFieldSum() functions together.

Example

Let's say you want to calculate the percent of projected revenue to total revenue. The formula to calculate the percent of projected revenue to total revenue is % Projected Revenue to Total Revenue = Projected Revenue / (Current Revenue + Projected Revenue).

The Customer record type has a currentRevenue field, which displays the current revenue generated by each customer. The Account record type has a projectedRevenue field, which displays the forecasted revenue for each customer account according to the sales department.

To calculate the percent of projected revenue to total revenue, you could create a new custom record field on the Customer record type that evaluates in real-time so you can reference the related record field from the Account record type in your calculation.

The expression would look something like this:

1
2
3
4
5
6
7
8
9
a!customFieldDivide(
  numerator: recordType!Customer.relationships.account.fields.projectedRevenue,
  denominator:  a!customFieldSum(
    value: {
        recordType!Customer.fields.currentRevenue,
        recordType!Customer.relationships.account.fields.projectedRevenue
    }
  )
)
Copy

Supported functions

You can use any of the following supported functions in either parameter of a!customFieldDivide(). However, you must reference a record field, related record field, or another Custom Field function in at least one 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 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