I want to get OTP from email list but first how should I unread email that is from “abc@xyz.com” ? Then How should I get OTP from that email body?
Can someone explain me or if possible send me an example flow.
Note : If I have multiple unread emails.
Thank You
Hi @PALKUMARI_PATEL,
If you have multiple email then you should be having the unique subject for the OTP email right?
SO you can read the email in the above way.
And can you please paste the body here? So that I can help you out with the expression.
Thanks!
Hey @shreyash_shirbhate Thank for responding.
How to filter that email? I mean where ?

And email body is :
Dear PAL,
Your One-Time Passcode is 123456
This code can only be used once and is valid only for 10 minutes. This does not replace your password.
You recently tried to access a secure application from Windows system using Chrome Browser.
If you did not attempt access to a secure application using your credentials, please report the incident to xyz@abc.com
Thank you,
ABC
1 Like
Hi, You can do filter according to the subject. Write the filter condition in the filter property in the properties panel.
Check this for the same.
After filtering the email try the below regular expression which will retrieve you the OTP.
@PALKUMARI_PATEL
Regex.Match(YourEmailBodyOutput, [a-z0-9]\d[a-z0-9]).Value
and save the above in String Variable.
Check the match Image:
1 Like
It only about subject, can I use Sender email address instead of subject to filter?
Got it. If you can provide me a flow that would be a big help. thanks
You can multiple condition in it @PALKUMARI_PATEL
Can you please send me the subject here? @PALKUMARI_PATEL
Subject is :

But concern about if other emails have same subject for OTP then ? So that’s why I want to read only particular email address .
Sam_Abraham
(Sam Thomas Abraham)
11
Hi @PALKUMARI_PATEL ,
You can verfy whether the particular mail came from a mail id using the expression below"
mail.From.Address.Contains(“”)
Please refer the below link for reference
1 Like
Hey @Sam_Abraham Thanks for sharing, I am able to get the emails I want.
1 Like
You can always select the top one which is unread.
You will see this option in properties panel. @PALKUMARI_PATEL

in top section do it 1.
Thanks.
1 Like
Hi @PALKUMARI_PATEL,
Can you please mark the appropriate post as a solution so that it will be helpful for other forum members!
Thanks!
2 Likes
system
(system)
Closed
15
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.