We will validate the email address that we just extracted using a regular expression:
- To create this validation functionality, let's add a String Find action. We will use the Source string as the EmailID variable, and within the Find string, we will paste the following standard regular expression to validate emails: ^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}. Then we'll assign this output to a new variable called output, as shown in the following screenshot:
- Let's now add an If action to check whether we got the email format correct before we invoke the Child bot to enter this data in Freshsales. We will use the Number condition to check whether the variable output has a value of 1, which means the email format is good:
- Let's also add the If Else condition in case the email format is incorrect. We will add a Log to file action within this Else condition to indicate a bad email format...