Create and use formula constants

The highlighted information on this page refers to functionality not yet generally available. It is available only in the Preview environment for all customers. After the release to Preview, the same features are also available monthly in the Production environment for customers who enabled fast releases.

For information about fast releases, see Enable or disable fast releases for your organization.

Formula constants are globally defined, reusable expressions that you can reference in calculated fields in Adobe Workfront.

Like a calculated field, a formula constant has three components:

  • Name: A unique identifier that cannot be changed after you create the constant.
  • Expression: A valid formula expression.
  • Description: (Optional) The purpose of the formula constant.

Unlike calculated fields, whose expressions are defined within a specific custom form, formula constants are defined globally. You can reuse the same expression across multiple custom forms without duplicating calculation logic.

Access requirements

Expand to view access requirements for the functionality in this article.
table 0-row-2 1-row-2 2-row-2 layout-auto html-authored no-header
Adobe Workfront package Any
Adobe Workfront license

Standard

Plan

Access level configurations Administrative access to custom forms

For information, see Access requirements in Workfront documentation.

Create a formula constant

  1. Click the Main Menu icon Main Menu in the upper-left corner of Adobe Workfront, then click Setup Setup icon .

  2. In the left panel, click Custom Forms, then Formula constants.

    The Formula constants page displays a list of existing formula constants.

  3. Click New formula constant.

  4. Enter a unique name for the formula constant.

    You cannot change the name after you save the formula constant.

  5. Enter a valid expression.

  6. (Optional) Enter a description.

  7. Click Save.

INFO
Example: The following formula constant calculates the number of days between a project’s planned start date and a custom release date.
table 0-row-2 1-row-2 2-row-2 layout-auto html-authored no-header
Name DaysUntilRelease
Expression DATEDIFF({DE:releaseDate}, {plannedStartDate})
Description Calculates the number of days between the planned start date and the release date.
This expression combines a native field (plannedStartDate) and a custom field (releaseDate).

Use a formula constant in a calculated field

  1. Open a custom form.
  2. Select a calculated field.
  3. Click Maximize to open the calculation editor.
  4. Locate the Formula constants section on the right side of the editor.
  5. Click the formula constant to insert it into the expression, or enter its reference directly in the expression editor.

Formula constant references use the {CONST:constantName} syntax, similar to custom field references, which use the {DE:fieldName} syntax.

INFO
Example: To reference the DaysUntilRelease formula constant, enter {CONST:DaysUntilRelease}.
You can also combine formula constants with other functions, fields, and operators. For example, the following expression checks whether the number of days until release exceeds 30:
IF({CONST:DaysUntilRelease} > 30, "Extended", "Standard")

For more information about calculated fields, see Add calculated fields to a form.

Use native and custom fields in formula constants

Calculated fields are associated with the object types of their custom forms, so their expressions can reference only fields supported by those object types. For example, you can use the native field {firstName} in a calculated field on a User custom form, but not on a Project custom form.

Formula constants are not associated with a specific object type. When you define one, you can reference any native or custom field in the system.

Object type restrictions still apply when you use a formula constant in an expression. For example, a formula constant named FullName has this expression:

CONCAT({firstName}, " ", {lastName})

You can use this constant in a calculated field on a User custom form. You cannot use it on a Project custom form, because the Project object type does not support the referenced fields.

Defining a formula constant globally does not override object type restrictions.

Nest formula constants

A formula constant can reference other formula constants. This lets you break complex calculations into smaller, reusable expressions.

INFO
Example: The ReleaseDurationInWeeks formula constant references the DaysUntilRelease formula constant to calculate the duration in weeks.
Name: ReleaseDurationInWeeks
Expression: {CONST:DaysUntilRelease} / 7

Edit a formula constant

After you create a formula constant, you cannot change its name. You can update its expression.

When you edit a formula constant, the edit dialog lists the custom forms that reference it in their calculated field expressions.

When you save your changes, the Apply to existing calculations checkbox controls whether existing calculated field values are recalculated with the updated expression:

Selected
After you save, calculations are recalculated for all existing objects that have the affected custom forms attached.
Not selected
Existing calculated field values do not change when you save. Subsequent calculations use the updated expression.

Formula constant limitations

Name uniqueness
Each formula constant must have a unique name.
Name modification
You cannot change names after you create the constant.
Constants per calculated expression
Maximum of 100.
Nested constant depth
Maximum of 10 levels.
Object type compatibility
All referenced fields must be supported by the object type in which you use the constant.
recommendation-more-help
workfront-help-quicksilver