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 / Data from plain text e...
Power Automate
Answered

Data from plain text email body

(0) ShareShare
ReportReport
Posted on by 5

Thank you for taking the time to read this.

 

I am working at building a flow that extracts text from received email. The email is plain text and all the examples I have come across are html and use the html to text option. The text I am looking for is the following.

 

Notification Source: Service

Notification Type: RECOVERY

 

Service: NotRealService

Host: NotRealHost

Host Alias: NotRealHostAlias

Address: x.x.x.x

 

I have followed the examples using the html to text but, text becomes one line with no delimiters.

 

Notification Source: Service Notification Type: RECOVERY Service: NotRealService Host: NotRealHost Host Alias: NotRealHostAlias Address: x.x.x.x

 

I tried splitting the output of the compose but the split function does not like that. The information after the colon varies in length. Normally I would loop through the rows and match the text to the left of the colon, then assign accordingly.

 

Ideally what I am trying to do is find the data Host: (and other data listed above) and take everything to the right of the colon. and assign it to a variable. var_Host, var_Service, and so on.

 

I am going to keep at it and search more through this forum.

 

Any help is appreciated. Thank you for your time.

 

Paul

Categories:
I have the same question (0)
  • Verified answer
    v-chengfen-msft Profile Picture
    Microsoft Employee on at

    Hi @itman0806 ,

    Please use split to separate the required content, and use the headings before and after the required part as the dividing line

    As long as the title does not change, you can accurately obtain the required content

    I made a template for your reference:

    vchengfenmsft_0-1679622810353.png

    vchengfenmsft_3-1679623063908.png

     

    vchengfenmsft_1-1679622859813.pngvchengfenmsft_2-1679622869912.png

     

    Notification Source:   trim(first(split(last(split(outputs('Html_to_text')?['body'],'Notification Source:')),'Notification Type:')))
    Notification Type:   trim(first(split(last(split(outputs('Html_to_text')?['body'],'Notification Type:')),'Service:')))
    Service:  trim(first(split(last(split(outputs('Html_to_text')?['body'],'Service:')),'Host:')))
    Host:   trim(first(split(last(split(outputs('Html_to_text')?['body'],'Host:')),'Host Alias:')))
    Host Alias:   trim(first(split(last(split(outputs('Html_to_text')?['body'],'Host Alias:')),'Address:')))
     
    Address:  trim(last(split(outputs('Html_to_text')?['body'],'Address:')))
     

    Best Regards

    Cheng Feng

  • itman0806 Profile Picture
    5 on at

    @v-chengfen-msft ,

     

    Thank you for the detailed information. This is very helpful. To help me visualize the steps I broke them out.

     

    This is also giving me more ideas on how to use power automate flows.

     

    Thank you again for your time.

     

    Paul

     

     

    PA-list.png

     

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
Valantis Profile Picture

Valantis 711

#2
Vish WR Profile Picture

Vish WR 691

#3
Haque Profile Picture

Haque 525

Last 30 days Overall leaderboard