How to grab OTP from email and populate in web

I am the beginner learner of UIPath.
I would like to know how does UIPath able to grab the six digits OTP code from email and inputting it in web page?

Thank you.

@lmyu

Welcome to our UiPath community.

First read the email body from mailbox based on subject and then use Regular expression or String manipulation functions to fetch the OTP from it.

Hi Lakshaman,
Thank you for your prompt reply.
I try using Get Outlook Mail message, however still not able to populate the OTP values into web. Could you please verify it for me? TQVM!

Get Outlook Mail Message
Assign → mailBody = mbxLocal(0).Body.ToString
Assign → mailVerificationCode = mailBody.substring(mailBody.indexof("Verification Code is : ")+"Verification Code is : ".length)
Message Box → mailVerificationCode

Define variable
mbxLocal → List → GetVerCode
mailBody → GetVerCode
mailVerificationCode → GetVerCode

Hi Lakshman,
It show error message of Get Outlook Mail Message: The specific folder does not exist.

@lmyu ,

Have you specified the Correct Folder in Get Outlook Mail Messages Activity ?

The Folder value Should be "Inbox", unless you have a Different Folder that you want to Read from.