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 Automate
Answered

Extracting Text

(1) ShareShare
ReportReport
Posted on by 266
I'm trying to build a flow that will extract the email from the description field of a Planner task.  Currently my flow has 3 steps- When a task is completed, Get task details and Compose.  The input value for the Compose is the dynamic content [description] from the Get task details.  When I run the flow, it runs as expected and Compose is returning everything in the description field.  My question is how do I get it to only return the individual's email?  I don't know how to write the expression to only extract the email.  Below is the output from Compose and some screen shots.
 
Output from Compose:
Request Details:
Requestor Email: my.email@yahoo.com
Date of Request: 2025-02-12
Name of person submitting request: Mike Jones
Contact Phone Number:741-855-7050
Property Address: 150 E Fourth Street
Services Needed: Dishwasher is not working.
Time Submitted: 2/12/2025 4:39:23 PM
 
Raw output:
"Request Details:\r\nRequestor Email: my.email@yahoo.com\r\nDate of Request: 2025-02-12\r\nName of person submitting request: Mike Jones\r\nContact Phone Number:741-855-7050\r\nProperty Address: 150 E Fourth Street\r\nServices Needed: Dishwasher is not working.\r\nTime Submitted: 2/12/2025 4:39:23 PM"
 
Categories:
I have the same question (0)
  • Suggested answer
    Sam_Fawzi Profile Picture
    904 Super User 2026 Season 1 on at
    To extract the email from the description field in your flow, you can use an expression in the Compose step to isolate the email address. Since the email is formatted as "Requestor Email: my.email@yahoo.com", you can use the following expression:
     
    substring(outputs('Get_task_details')?['body/description'], indexOf(outputs('Get_task_details')?['body/description'], 'Requestor Email:') + 18, indexOf(outputs('Get_task_details')?['body/description'], '\r\n', indexOf(outputs('Get_task_details')?['body/description'], 'Requestor Email:')) - (indexOf(outputs('Get_task_details')?['body/description'], 'Requestor Email:') + 18))
    
    Explanation:
    1. indexOf: Find the starting index of "Requestor Email:".
    2. + 18: Move the index to the start of the email address (18 characters after "Requestor Email:").
    3. substring: Extract the substring starting from the email address until the next line break (\r\n).
    4. Second indexOf: Find the position of the next line break after the email to get the correct length.
    Make sure to replace outputs('Get_task_details')?['body/description'] with the correct dynamic content reference if necessary. This should give you just the email address.
     
  • Mike44 Profile Picture
    266 on at
     
    Power automate says the expression is not valid.  
  • Verified answer
    rzaneti Profile Picture
    4,476 Super User 2026 Season 1 on at
    Hi @Mike44,
     
    You will need to combine a few text expressions to extract the email address. A possible one is trim(first(split(last(split(outputs('Get_task_details')['body/description'], 'Requestor Email:')), 'Date of Request'))). If the expression doesn't work, replace the text in red for the dynamic content of the description property from your Get task details action. 
     
    In a quick summary, we are simply splitting your text in two, using "Requestor Email:" as separator. We then take second part and split it again in two parts, at this time by "Date of Request". We finally take the first part, and there you have your email address :)
     
    You can check following content for further reference:
    - Video - Automate data extraction from email to Excel with Power Automate: https://youtu.be/RIaAi6Cmevw
    - Video - Using dynamic content in Power Automate: https://youtu.be/jpledJfaEPQ
    - Blog - How to extract and clean texts with Power Automate: https://digitalmill.net/2023/08/12/how-to-extract-and-clean-texts-with-power-automate/
    - Blog - Writing expressions in Power Automate: https://digitalmill.net/2024/02/27/writing-expressions-in-power-automate/
     
    Let me know if it works for you or if you need any additional help!
     
    If this is the answer to your question, please mark the post as Accepted Answer.
    If this answer helps you in any way, please give it a like.

    Check more Power Platform content on my website.
    Lets connect on LinkedIn.
  • Mike44 Profile Picture
    266 on at
    @rzaneti  Hot dog, that worked.  Thank you so much!

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 801

#2
Valantis Profile Picture

Valantis 602

#3
Haque Profile Picture

Haque 581

Last 30 days Overall leaderboard