web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to copy a code fro...
Power Automate
Answered

How to copy a code from email into browser

(1) ShareShare
ReportReport
Posted on by
Hello,
There is a web-site I normally use which requires a 2-step authenticator each time I log in; The passcode is sent to my email each time. I would like to make my flow log in to this website and know that it needs to go to email and copy just the piece of the code and paste it back to the website. 
Can someone please let me know if this is possible from Power Automate Desktop and if so, how. I am very new to PA. Thanks!
Categories:
I have the same question (0)
  • Verified answer
    MS.Ragavendar Profile Picture
    5,036 Super User 2025 Season 2 on at
    • Launch Power Automate Desktop and create a new flow.
    • Use the "Launch new browser" action to open the website.
    • Use the "Wait for web page to load" action to ensure the page is fully loaded.
    • Use the "Fill text in web form" action to enter your username and password into the login form.
    • Use the "Press button on web page" action to click the login button.
    • Use the "Wait" action to pause the flow for a few seconds/mins depends on network to allow time for the 2FA code to arrive in your email.
    • Use the "Get emails (V3)" action to retrieve the latest email from your inbox. Configure this action to:
    • Connect to your email account (e.g., Outlook, Gmail).
    • Filter emails by subject or sender to ensure you retrieve the correct email containing the 2FA code.
    • Use the "Extract text with OCR" action to extract the 2FA code from the email body. This is necessary because the code is often embedded in the email text.
    • Use the "Extract text from variable" action to isolate the 2FA code from the email body. For example:
    • If the email body contains text like Your verification code is: 123456, you can use a regular expression or text manipulation to extract 123456.
    • Store the extracted code in a variable (e.g., TwoFACode).
    • Use the "Fill text in web form" action to enter the 2FA code (stored in the TwoFACode variable) into the 2FA input field on the website.
    • Use the "Press button on web page" action to submit the 2FA code.
    • Use the "Wait for web page to load" action to ensure the page loads after submitting the 2FA code.
      Use the "Find UI element in web page" action to check for a specific element on the page (e.g., a "Welcome" message) to confirm that the login was successful.
     
    Hope this will helps!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard