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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Extracting text from a...
Power Automate
Unanswered

Extracting text from a flagged email

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

We currently receive applications through a form on our website, these details are then sent in a table on email to a specific email address.

 

I'm trying to set up an automated flow that extracts the name and email address from the table in the email so that these can be used to populate an automated reply (when the email is flagged in Outlook).

 

I've managed to set up the trigger and have used the HTML to text function to extract the main body of the email as shown in the image below. I have however got stuck on how to best extract the name and email address individually (these will be different for each application) - there seems to be a few items about this on here already but nothing that I can make sense of in my particular set up.

 

Any help would be gratefully received, thank you!

 

LaurenAddison_1-1657107025938.png

 

Categories:
I have the same question (0)
  • Shujaath_Khan Profile Picture
    1,111 Super User 2024 Season 1 on at

    Hi @Anonymous 

    did you try to extract entities template to read the email?  This requires AI Builder

     

    https://powerautomate.microsoft.com/en-US/templates/details/31447fb6886d43bf8e016b77f4cb292a/extract-entities-of-received-emails-using-ai-builder/

     

    Thanks
    Please click Accept as Solution on this reply if it helped to solve your issue, and thumbs-up if you feel this is useful or important in other ways as a boost.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    That's helped a little bit, it's got the information into a table, but how do I now extract the name and email address as individual items to that I can automate the email address in the 'to' field of an email and personalise the beginning of the email with their name please?

     

    LaurenAddison_0-1657181817212.png

     

  • Shujaath_Khan Profile Picture
    1,111 Super User 2024 Season 1 on at

    @Anonymous 

     

    Ok, if you've outputs in form of an array before creating html table you can try below expression to get first email from JSON array. which you can set in To field

    first(variables('JSONArray'))['Email']

     

    Thanks

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Sorry, not sure what you mean? Can you explain in more detail please?

  • Shujaath_Khan Profile Picture
    1,111 Super User 2024 Season 1 on at

    @Anonymous can you try to extract email(by using above shared syntax) from same data which you're trying to pass it to create HTML table?

     

    Shujaath_Khan_2-1657558441158.png

     

     

     

    formula for filter array in advance mode

    @equals(item()['EntityType'], 'Email')

    from here you should be able to grab Entitypevalue of Email

    and for compose to grab first object from array

    first(body('Filter_array'))['EntityValue']
     
    Thanks
    Please click Accept as Solution on this reply if it helped to solve your issue, and thumbs-up if you feel this is useful or important in other ways as a boost.
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I'm clearly doing something wrong, although I'm not sure what - sorry!!

     

    I'm getting this error:

    Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language expression 'first(body('Filter_array'))['EntityValue']' cannot be evaluated because property 'EntityValue' cannot be selected. Please see https://aka.ms/logicexpressions for usage details.'.

     

    This is what I'm getting from the test:

    LaurenAddison_0-1657640033399.png

     

    This is how the flow is set up:

    LaurenAddison_1-1657640089825.png

     

    I clearly don't know what I'm doing!! I might just give up and save us both some time.

     

  • Shujaath_Khan Profile Picture
    1,111 Super User 2024 Season 1 on at

    hi @Anonymous 

    can you keep the step composed in if a condition like below

    you're getting exception error cause in rest of the cases JSON would be empty array besides Email

    length(body('Filter_array')) > 0
    Shujaath_Khan_0-1657640619916.png

    Thanks
    Please click Accept as Solution on this reply if it helped to solve your issue, and thumbs-up if you feel this is useful or important in other ways as a boost.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Now set up as:

    LaurenAddison_0-1657641360305.png

    And getting this error:

    LaurenAddison_1-1657641394882.png

     

  • Shujaath_Khan Profile Picture
    1,111 Super User 2024 Season 1 on at

    it's not an error it didn't go in one of the 14 iterations you've.. best you can do is 

    1.initialize a variable on top of the flow like varEmail and

    2. set variable value instead of using compose action so you can store result in varEmail and use as needed

    thanks

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard