From: ‘XXXXX’
To: ‘XXXXXXXXXX’
When: 2023-10-07 11:20:29
G-672921 is your Google verification code.
Above is the Body of the email that I’m trying to get UiPath to locate, read and then extract the code after the G-. I’m currently stumped as to how to go about it.
To extract the verification code from the email body using UiPath, you can use string manipulation techniques. Assuming the email body is stored in a variable called emailBody, you can follow these steps:
Use Regular Expressions:
You can use regular expressions to find and extract the verification code (G-XXXXXX) from the email body. Here’s an example of how to do it:
Use Use the “Get IMAP Mail Messages” Activity
You can access the email’s body using the .Body property of the MailMessage object. Store the email body in a variable (emailBody).
Use a regular expression to search for the verification code pattern.