Creating a Constant

A Constant is used to store a fixed value. A constant value can't be changed throughout the execution once it has been assigned a value. You can use the Constant all over your Flow, for example, while creating a record, performing an update, or with delete operations.

A business scenario: Alice Atwood is working as a system administrator in Universal Container. Currently, she is developing a Visual Workflow and wants to create a Constant that can be used to store an organization's name.

To add a Constant to your Flow, follow these instructions:

  1. Navigate to Setup | Build | Create | Workflow & Approvals | Flows.
  2. Click on the New Flow button; it will open the Flow canvas.
  3. Then navigate to the Resources tab and double-click on Constant, available under the CREATE NEW section, as shown in the following screenshot:
    Creating a Constant
  4. This will open a window for you where you have to enter the following details:
    • Unique Name: Enter a unique name. The name must begin with a letter and use only alphanumeric characters and underscores. Uniqueness applies only to elements within the current Flow. Use ConOrgName as the unique name.
    • Description: Write some meaningful text so that another developer/administrator can easily understand why this constant variable has been created. When you select a variable in the Explorer tab, a description appears in the Description pane.
    • Data Type: This determines which types of values a variable can store. Select the Text data type. Other available data types for a variable are as follows:
      • Text: This is used to store any combination of letters and numbers.
      • Number: This is used to store any numbers.
      • Currency: This is used to store currency.
      • Date: This is used to store the date.
      • Boolean: This is used to store either true or false values.
      • Value: This allows you to set a value for the constant. You can either manually enter the value or use the drop-down list {!$GlobalConstant.EmptyString} to assign the null value to Constant. In this case, enter the organization name, Universal Container.

    This will look like the following screenshot:

    Creating a Constant
  5. Click on the OK button.

Note

For the best practice, in this book we will use Con as the prefix for Constant. For the date value, you must use the MM/DD/YYYY format. For the date/time value, you must use the MM/DD/YYYY HH:SS A format.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.19.63.106