Name It New Account in the Label Field. In Screen Components

Adding Validation to Flow Screen Components

Concluding Updated on February x, 2022 by

Big Thought or Indelible Question:

How practice yous validate user input for Screen Menses Components?

Input Validation in Salesforce Catamenia allows a system administrator to define custom logic and fault messages to ensure data integrity. A Validation tin can contain a formula or expression that evaluates the data in ane or more than fields and returns a value of True or Fake . Validation besides includes an error message that displays when the dominion returns a value of Truthfulindicating that inaccurate data is being entered.

In the past, I have written a few articles on Validation Rules and Salesforce Catamenia. Why not bank check them out while you are at it?!

  1. Getting Started with Salesforce Flow – Function 21 (Validation Rule using a before-relieve Flow? Yes!)

Objectives:

After reading this commodity, you volition be able to:

  • Add validation to check what a user enters in a menstruum screen component and display an mistake message to guide the user
  • Display colorful fault message
  • and much more

Business concern Use Case

Steven Greene,  aLeadOrganizationAdministrator at Universal Containers (UC),receiveda requirementto create a Screen Period with the post-obit fields:

  1. City – Only alphabet characters (A-Z or a-z) are allowed
  2. Telephone – Minimum 10 and Maximum 15

Automation Champion Arroyo (I-exercise):

To solve the above business use case, will use Screen  Flow.

Before discussing the solution, permit me show you a diagram of a Process Flow at a high level. Please spend a few minutes to become through the following Flow diagram and empathise information technology.

Let's begin building this automation procedure.

Guided Practise (Nosotros-do):

There are four steps to solve Steven'due south business requirement using Screen Period . Nosotros must:

  1. Salesforce Flow Steps: Ascertain menstruation properties
  2. Add a screen to capture the user's input
  3. Add a Text component to store the city
    1. Add input validation to validate user input
  4. Add a Phone component to store the Mobile Number
    1. Add input validation to validate user input

Step 1: Salesforce Flow – Define Period Properties

  1. Click Setup .
  2. In the Quick Find box, blazon Flows .
  3. Select Flows then click on the New Catamenia .
  4. Select the Screen Menstruum option and click on Next and configure the flow as follows:
    1. How practise y'all want to get-go edifice : Freeform
  5. It will open the flow designer for you.

Footstep 2: Salesforce Flow – Add a Screen Element

  1. Under Toolbox , select Elements . Drag and drop Screen onto the canvas.
  2. Input the following information :
    1. EnterLabel  theAPI Name  will car-populate.
  3. Click Done .

Step 3: Salesforce Menstruation – Add a Text Component to Store the City

  1. Under Input section on Screen Chemical element . Drag and drop the Text  component onto the screen.
  2. Input the post-obit information :
    1. Enter a name in the Label  field; the API Name will car-populate.
    2. Select Crave checkbox.
  3. Click Washed

Step 3.1: Salesforce Flow – Add Input Validation to Validate User Input – Metropolis

It's fourth dimension to add a validation check to verify that metropolis only contains alphabet characters (A-Z or a-z).

  1. Under the Text Component, aggrandize the Validate input section.
  2. Now we volition define the values allowed for the component by entering a Boolean formula.
  3. Input the post-obit information :
    1. Error Message : Delight input alphabet characters only
      1. Use Rich-Text editor to format error message
    2. Formula : REGEX( City, "[a-zA-Z ]*$")
  4. Click Done .

Footstep 4: Salesforce Menstruum – Add a Phone Component to Store the Mobile Number

  1. Under Input department on Screen Chemical element . Drag and drop the Phone  component onto the screen.
  2. Input the following information :
    1. Enter API Name .
    2. Field API Name : MobileNumber
    3. Label : Mobile Number
    4. Required : {!$GlobalConstant.Truthful}
    5. Advanced > Revisted Screen Values : Use values from when the user final visited this screen
  3. Click Done

Step 4.1: Salesforce Flow – Add Input Validation to Validate User Input – Mobile Number

It's time to add a validation check to verify the length of the mobile number. For this, we will use the regex in the Phone component.

  1. Under the Phone Component, expand the Field Properties section.
  2. Now we will use the regex to validate the length
    1. Pattern : ^[\d]{10,xv}
  3. Click Washed .

In the end, Steven's Flow will look like the following screenshot (I turned on Auto-Layout) for this flow:

Once everything looks good, perform the steps below:

  1. Click Save .
  2. Enter CatameniaCharacterization  theAPI Name  volition auto-populate.
  3. Click Prove Advanced .
  4. Type : Screen Menstruation
  5. API Version for Running the Period : 51
  6. Interview Label : User Input Validation  {!$Menstruum.CurrentDateTime}
  7. Click Salve .

Things to Remember:

  1. The formula expression must render a Boolean value (true or false).
  2. If the formula expression evaluates to truthful, the input is valid.
  3. If the formula expression evaluates to false, the error bulletin is displayed to the user.
  4. If the user leaves the field blank and the field is non required, the menstruation doesn't validate.
  5. If the user leaves the field bare and the field is required, the menses shows the default error message and not the custom error message.

Proof of Concept

At present menstruum will display an error message if the user doesn't enter the data correctly.

Determinative Cess:

I want to hear from you!

What did you learn from this post, is it relevant to you, and how will you modify the concepts taught in the post for your own business organization processes?

Make a post and tag me on Twitter @automationchamp using #AutomationChampionFlow.

sheltonallic1975.blogspot.com

Source: https://automationchampion.com/2021/02/01/adding-validation-to-flow-screen-components/

0 Response to "Name It New Account in the Label Field. In Screen Components"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel