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 / Extract email address ...
Power Automate
Answered

Extract email address from PowerApps dynamic email field and send email using Power Automate

(0) ShareShare
ReportReport
Posted on by 93

I created an inspection form in Power Apps for site visits. The inspection form has an email field that the inspector will populate with the site business owner's address to email a PDF copy of the inspection report. I've figured out a way to extract the email address using this Shane Young video: Turn emails into data - Flow String functions, Email with options, terminate, and more. The problem is that in his video he uses character count to extract a name from a form,  I tried using the same method to extract the email address from my form.  So I used some of his methods but inserted some of my own since the email field in my form is dynamic, I inserted an HTML to Text action (to extract the email and turn it into a text string), followed by an Initialize variable action (for the converted email text string). However, as I suspected, it worked with the content I had in the form but once I changed the content, it didn't work because the character count changes when the content changes.

ljkeefe_0-1651866524831.png

 

This is the rest of my Flow 

ljkeefe_1-1651866744695.png

 

I have found similar posts but it is usually regarding a static email address in Flow. I'm very close, I was able to make Shane's method work but as I stated, it didn't account for the fields before to be dynamic and change the character count.

Your help is appreciated.

 

Thanks!

Categories:
I have the same question (0)
  • ljkeefe Profile Picture
    93 on at

    Nevermind. I actually figured it out using Shane's method in a roundabout way. Instead of calculating the start of the field, I calculated the end of the field where the actual email address would begin. I then used his method of ending that field by using the closing html tag with the use of another Compose action using the indexOf expression.

    indexOf(outputs('email'),'</p>')

      Created another Compose action for drawing out the Email only, using the substring expression:

    substring(outputs('email'),0,outputs('EndOfEmail'))

     Then used the Html to Text action, selecting the EmailOnly output. 

    Created a variable with Initialize variable using the Html to Text action at the value. Then I used this variable in the To: field in the Send an email action. 

  • ljkeefe Profile Picture
    93 on at

    After several tests, this method does not extract just the email from the form using the number of characters. Help is appreciated!

     

  • Verified answer
    ljkeefe Profile Picture
    93 on at

    I had to make a slight modification to my solution and have tested it with different email addresses and filling out the form and it works....thank goodness. So still a variation on Shane's email: 

    1. I created a Compose action, as he does to find the "Email:" string in my HTML, however, I included the Add expression with the IndexOf expression he uses to account for the characters of Email: which as you can see below is 6 characters which finds the email in the string. 

     

    Add(indexOf(triggerBody()['text'],'Email:'), 6)

     

     Then the rest from the previous solution: 

     I then used his method of ending that field by using the closing html tag with the use of another Compose action using the indexOf expression.

    indexOf(outputs('email'),'</p>')

      Created another Compose action for drawing out the Email only, using the substring expression:

    substring(outputs('email'),0,outputs('EndOfEmail'))

     Then used the Html to Text action, selecting the EmailOnly output. 

    Created a variable with Initialize variable using the Html to Text action at the value. Then I used this variable in the To: field in the Send an email action. 

     

    Now it works!!

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard