Validating email addresses with regular expressions

We will validate the email address that we just extracted using a regular expression:

  1. 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:

  1. 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:

  1. 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: $System:Machine$-INFO - Bad Email format. Use Creation Failed:

We can now invoke the Child bot within the If condition. We will add a Step action, as shown earlier. Within this Step action, we will add the steps to invoke the Child bot and create a new user in Freshsales. 

But before that, we need to create the Child bot. Let's save the Parent bot and close the bot. We are now ready to create the Child bot. 

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

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