Skip to main content

Notifications

Community site session details

Community site session details

Session Id : M536Ub7obZhXCpnFJpX4et
Power Automate - Building Flows
Answered

Extract email address from body of an ShareCenter Notification email body

Like (1) ShareShare
ReportReport
Posted on 8 Apr 2024 00:46:13 by 29
Good day,
I am trying to build a cloud flow so what I am trying to achieve is to:
 
 
1. ShareCenter Notification Email arrives to your mailbox > Flow reads an email and look for email address inside an email body > send a MS Teams Reminder to the person mentioned in the email body including some details mentioned in the email body. 

An example of an email:

From: notifications@mail.XXXeim.com
Subject: H00000-AST-0001 - COMPLETED - H00000 - Document Name

 

Assist Details

Title

Document Name

Number of Documents

1

Number

H00000-AST-0001

Support Coordinator

xxxxxx

 

Assist Links

Assist Workflow Link (hyperlink in the email)

Access the Assist Workflow

Document Set Link 

Access the Document Set

Support Link 

Access Support Materials for the Assist Workflow


I assume it would be 'Html to Text' which I should use however I am not sure how. 

Once the email address is extracted, I believe can then use the action 'Create a Chat' to add the person's email address in there as a dynamic content, then use the action 'Post message in a chat or channel' to add the conversation ID from the 'create a chat' in the group chat accordingly.

I have included the steps of the flow for your brief information. 

Thank you for your attention and help in advance!
  • Verified answer
    HG123 Profile Picture
    29 on 11 Apr 2024 at 05:15:50
    Re: Extract email address from body of an ShareCenter Notification email body

    As a solution I searched some more posts on this forum and tried using the following Expression to strip the email address with hyperlink and it worked: 

    trim(first(split(last(split(body('Html_to_text'),'<')),'[https://can01.safelinks.protection.outlook.com')))
     
     
  • SudeepGhatakNZ Profile Picture
    14,318 Most Valuable Professional on 08 Apr 2024 at 06:32:44
    Re: Extract email address from body of an ShareCenter Notification email body

    Provide the output of HTML to text action inside the Set variable action

     

  • HG123 Profile Picture
    29 on 08 Apr 2024 at 05:37:36
    Re: Extract email address from body of an ShareCenter Notification email body

    I also tried to do the apply to each step as shown in the screenshot for some reason it shows the above error. 

     

    Thanks. 

  • HG123 Profile Picture
    29 on 08 Apr 2024 at 05:31:42
    Re: Extract email address from body of an ShareCenter Notification email body

    Would you mind to also share the detailed screenshot of the following steps:

     

    'Set Variable'

    'Compose' (second last step)

    & 'Compose Copy'?

     

    Thank you very much!

  • SudeepGhatakNZ Profile Picture
    14,318 Most Valuable Professional on 08 Apr 2024 at 05:16:36
    Re: Extract email address from body of an ShareCenter Notification email body

    Hi @HG123 ,

    The variable type is String and it is initially blank.

    The email is extracted using expressions, so it should work for other emails too

     

  • HG123 Profile Picture
    29 on 08 Apr 2024 at 04:34:04
    Re: Extract email address from body of an ShareCenter Notification email body

    Good day Sudeep,

     

    Many apologies that I might not have clearly explained in my previous posts that, the "Workflow Initiator"'s name, hence the workflow initiator's email address on the ShareCenter Notification email is different for each email, so john.smith@companyemail.com is just a sample and this field changes all the time. 

     

    If we are still using the 'initialise variable', would it be possible if can please advise the 'type' and 'value' for that?

     

    Thank you!

     

     

  • SudeepGhatakNZ Profile Picture
    14,318 Most Valuable Professional on 08 Apr 2024 at 03:39:32
    Re: Extract email address from body of an ShareCenter Notification email body

    @HG123 

     

    SudeepGhatakNZ_0-1712547465215.png

     

    SudeepGhatakNZ_1-1712547561918.png

     

  • HG123 Profile Picture
    29 on 08 Apr 2024 at 01:00:03
    Re: Extract email address from body of an ShareCenter Notification email body

    Sorry the email body did not show the workflow initiator please refer to the following email body instead:

    From: notifications@mail.XXXeim.com
    Subject: H00000-AST-0001 - COMPLETED - H00000 - Sample Document Name

    ASSIST

    Assist Number

    H00000-AST-0001

    Assist Title

    Sample Document Name

    Workflow Action

    Approved by Rose, Sandra

    Due Date

    2024-04-10

    Workflow Initiator

    Smith, John

     <john.smith@companyname.com>

     

    Assist Type

    DM Assistance Required

     

     

     

    Assist Details

    Title

    Sample Document Name

    Number of Documents

    1

    Number

    H00000-AST-0001

     

    Support Coordinator

    xxxxxx

     

    Assist Links

    Assist Workflow Link

    Access the Assist Workflow

    Document Set Link

    Access the Document Set

    Support Link

    Access Support Materials for the Assist Workflow

     

    Thanks again for your attention and help in advance!

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,743 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,079 Most Valuable Professional

Leaderboard