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
| 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
-
Click the Main Menu icon
in the upper-left corner of Adobe Workfront, then click Setup
.
-
In the left panel, click Custom Forms, then Formula constants.
The Formula constants page displays a list of existing formula constants.
-
Click New formula constant.
-
Enter a unique name for the formula constant.
You cannot change the name after you save the formula constant.
-
Enter a valid expression.
-
(Optional) Enter a description.
-
Click Save.
| 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. |
plannedStartDate) and a custom field (releaseDate).Use a formula constant in a calculated field
- Open a custom form.
- Select a calculated field.
- Click Maximize to open the calculation editor.
- Locate the Formula constants section on the right side of the editor.
- 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.
{CONST:DaysUntilRelease}.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.
ReleaseDurationInWeeks{CONST:DaysUntilRelease} / 7Edit 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: