View this page in the latest version of Appian. Constant Object Share Share via LinkedIn Reddit Email Copy Link Print On This Page What is a constant? A constant is a design object that holds a literal value that can be called from any expression. Constants allow you to define a value once—such as a company name, a key date, or a web service endpoint—and reuse it across multiple objects in an application. Using constants makes applications easier to maintain, as you only need to update the value in one place to have it reflected everywhere. A constant can be referenced in other objects. To learn about referencing constants and other objects, see Referencing Objects in Expressions. When to use a constant Use a constant when you need to: Store reusable values: Define a value once and reference it across multiple expressions and objects in an application. Centralize updates: Update a value in a single location and have the change reflected everywhere the constant is used. Define environment-specific values: Configure values like usernames or endpoints that change between development, test, and production environments. Elements of a constant A constant contains the following elements: Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to close # Element Available Actions 1 Create Options Choose to create a new constant from scratch, or create a duplicate of an existing constant. 2 Name Enter a name for the constant. This name is used when calling the constant from an expression. We recommend following the Standard Object Names convention. Note that certain constant names are reserved for system use. 3 Description Enter a description for the constant. 4 Type Select the data type for the constant. Select the Array checkbox to store a list of values of the same data type. 5 Value Define the literal value that is returned when the constant is called. 6 Environment Specific Select this checkbox to prevent the constant's value from being updated on import, unless you've specified a value in an import customization file. You can only select this checkbox for constants that are a primitive data type or Email Address type.Constants should only be environment specific when their values are different based on the environment they are in. For example, a web service endpoint. 7 Save In Select the folder where the constant should be created. Reserved constant names Certain names are reserved for system use and cannot be used as constant names. The following reserved constant names are primarily used for process report metrics: Completion is_process_ontime is_process_overdue is_task_favorite is_task_ontime is_task_overdue Lag NetCompletion NetLag NetWork process_completion_time process_deadline process_ee_id process_start_time process_status pm_avg_completion pm_avg_lag pm_avg_work task_assignee_owner task_assignment_time task_attributed_to task_avg_completion task_avg_lag task_avg_work task_completion_time task_deadline task_ee_id task_status total_completion_time total_lag_time total_work_time Work Constant security Object security for constants is configured through role maps. By default, constants inherit the security of the folder that they are saved in. After creating a constant, you can disable that inheritance and modify the constant's security. See Editing Object Security to modify a constant's security. The following table outlines the actions that can be completed for each permission level in a constant's security role map: Actions Administrator Editor Viewer Deny Evaluate the constant Yes Yes Yes Yes View the constant definition Yes Yes Yes No Duplicate the constant Yes Yes Yes No Update the constant definition* Yes Yes No No View the security Yes Yes No No Rename the constant Yes Yes No No Delete the constant Yes No No No Update the security Yes No No No Note: When a constant is used in an expression, the value that is returned is the same regardless of which user evaluates the expression. However, functions that use the value may fail based on the user's permission. For example, if the constant value is a group that the user does not have permission to see, the constant returns the value successfully but using the group() function returns an error. Common constant options A constant supports the following common design object options: Versioning: Constants support versioning. Renaming: Constants can be renamed. Viewing Appian design guidance: Constants support Appian design guidance. Duplicating: Constants can be duplicated. Object overwrite protection: Constants support object overwrite protection. The following option is not available for constants: Viewing performance details: Constants do not support viewing performance details. To view options available from the toolbar in Appian Designer, see Common view elements. Create a constant Constants of deprecated types cannot be created except by duplicating a constant of that type. To create a constant: In your application, go to the Build view. Click NEW > Constant. Configure the constant properties. Click CREATE. Edit constant properties To edit a constant's properties: In your application, go to the Build view. Select the constant name to open it. This displays the Constant Properties dialog. Edit the constant properties as needed. Click SAVE. Tip: You can also update the value of a constant programmatically in a process model using the Update Constant Smart Service or the Increment Constant Smart Service. Each time you modify and save a constant, a new version is created. All objects that use the constant will use the latest version. All versions are accessible to developers who can view the constant, and a constant can be reverted back to a previous version at any time. Duplicate a constant To duplicate a constant: In your application, go to the Build view. Select the checkbox next to the constant you want to duplicate. Click DUPLICATE. Update the duplicated constant properties as needed. Click CREATE. Move a constant Users with Administrator permission to this object or rule folder can move it to another folder: Navigate to the parent folder that the object or folder is in. Select the object or folder. You can select more than one. Click the Move button on the toolbar. The Move Objects dialog appears. Use the folder picker or browser to select the new parent folder. Tip: You can also create a new folder in the browser, if you have Editor permissions to its parent folder. Click Move. Note: Any objects that are configured to inherit the security of the parent folder assume the security rights of the target folder. Delete a constant Caution: Deleting a constant cannot be undone. Any objects that depend on it will be broken. Deleting a constant prevents users from further viewing or editing it. However, the last version of the constant is still available to be used in processes, record views, and interfaces. Appian does not recommend deleting constants that are in use because the constant can no longer be exported. To delete a constant: In your application, go to the Build view. Select the checkbox next to the constant you want to delete. Click DELETE. System administrators can delete multiple objects at once. In the Delete Constant? dialog, ensure there are no objects that depend on the constant. Note: If there are objects that depend on the constant, then deleting the constant will cause an error to appear in those objects. Click DELETE. Constant related resources Expression Rules: Constants are frequently used within expression rules to avoid hard-coded values. Referencing Objects in Expressions: Constants can be referenced using the cons! domain. Update Constant Smart Service: Constants can be updated programmatically within a process using this smart service. Feedback Was this page helpful? SHARE FEEDBACK Loading...