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 Apps / Unable to extract emai...
Power Apps
Unanswered

Unable to extract email address from a text file

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am trying to create a Power Automate. Flow supposed to be like below:

Email arrives to mailbox containing txt file.

Txt file contains lots of info but has mail addresses listed as below.

 

02:00:33 ### Count of new mailboxes: 4

 

user1@contoso.com 
user2@contoso.com
user3@contoso.com
user4@contoso.com

 

### 20231108_02:00:33 ### Check prerequisites and start migration of mailboxes... ###

 

The data should be pulled from the text file and converted from html-to-text and then should be stored in a particular variable which can used for other actions.

Below is my flow. Please let me know what else should I add.

yokamb_2-1699452060762.png

 

This setup converts the text file to plain text. But doesn't store onto a variable.

Categories:
I have the same question (0)
  • Jose Ramon Profile Picture
    107 on at

    You could achieve this using Azure OpenAI GPT (video where Reza Dorrani explains how to do it), but of course that comes at a cost. In case you don't want to use Azure OpenAI GPT, then you could get it using Text Functions with Find text position and Substring

     

    In Data Operation Compose: I put your text email

    In Data Operation Compose Split: I put the expression: 

    split(outputs('Compose'),'#')[3]

    In Find text position I am looking for the colon

    jrestebanez_0-1699459086305.png

    Start Position in Substring action: add(outputs('Find_text_position')?['body'],1)

    Data Operation Compose 2 expression is:

    take(skip(split(outputs('Substring')?['body'],decodeUriComponent('%0A')),4),add(length(skip(split(outputs('Substring')?['body'],decodeUriComponent('%0A')),4)),-4))

    • Split by carriage return
    • I discard the first 4 elements
    • Finally, from the result array, I take the first n elements and I obtain this value by looking at the length of the result array and removing the last 4 elements, which are also empty or carriage return values.

    And this is my final result:

     

    jrestebanez_3-1699460306358.png

     

     

    jrestebanez_2-1699459884415.png

     

    This is my final result:

    jrestebanez_0-1699460710047.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 Apps

#1
Vish WR Profile Picture

Vish WR 633

#2
11manish Profile Picture

11manish 588

#3
Valantis Profile Picture

Valantis 457

Last 30 days Overall leaderboard