Step-By-Step Guide to Use Regex Validator to Validate Email Id
Let's see an example of validating an E-mail Id.
To validate the E-mail Id:
- Create a new process.
- From the Canvas Tools panel, add the Regex Validator to the Flowchart designer on the Canvas.
- In the Parameter bar, create an In argument, EmailInput of type String and an Out argument, ValidationResult of type Boolean. These arguments are used to pass the required E-mail Id as input and store the result of validation respectively.
- Click the
(Settings) icon. The Regex Validator Mapping dialog box appears.
- Click Add to set the validator mapping.
- In the Arguments/Variables drop down list, select EmailInput argument defined above.
- From the Validator Type drop down list, select EmailID.
- Click CONFIRM.
- In the Output Mapping list, select ValidationResult argument defined above.
To view the output in Automation Studio, let's add WriteLine activity. You can assign this process to a robot if you want to execute this process outside Automation Studio.
- Add a WriteLine activity and in the Text field, enter ValidationResult to store the result of validation performed on the specified E-mail Id. Below is the sample automation process workflow created:
- Save the process.
- Setup the environment and then perform test run.
The Output console of automation Studio displays the validation result. Observe that the validation result received is False as the specified E-mail ID is not in the expected format. You can use the validation result to take appropriate action to perform the subsequent action such as display a message for the user to re-enter the E-mail Id in correct format.