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 / Parsing Text Expression
Power Automate
Unanswered

Parsing Text Expression

(1) ShareShare
ReportReport
Posted on by 84

Hello all,

 

I have a flow that is taking an email and converting it to plain text. I am then parsing the plain text to get specific values and use them as dynamic content. I have not found a good way to parse the needed text in one power automate expression. 

 

ex. 

Personnel Change Authorization (New Hire)

Please see the PCA details below for Jane Doe

Start Date: 7/29/2024
Job Code: 1234
Job Title: Director
Standard Hours: 40
New Hire Type: Rehire

 

Recruiter: Jimmy Johns
Supervisor: Papa Murhpy
Dept. Head Approval: Approved
Finance Dept. Approval: Approved
Name: Jane Doe
Preferred First Name:
Home Email: test@testing.com

 

Everything after the ":" is dynamic content, some of which I would like to parse. I am currently using 2 compose actions to get 1 value, seen below:

trim(split(outputs('Email_Plain_Text'), 'Start Date: ')[1])
and
trim(split(outputs('splitAtStartDate'), 'Job Code:')[0])
Wanted to see if there was a way to combine these so that I do not have to use 2 different expressions for this?
 
Additionally, when I am converting from HTML to plain text, it is breaking many of the lines and removing the space after the ":". I would like to not break all of these spaces since I will be putting the email body text into a description of a case in Salesforce. 
 
I am currently using the expression: replace(outputs('Html_to_text')?['body'], ':'': 'but there still seems to be an issue when it comes to the email as a whole. When put into an email for example, it looks like a run on sentence. 
 
Any help is appreciated!
 
Thank you,
Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,960 Moderator on at

    Hi @DH2023 

     

    Please always share your code, what it looks like, what's wrong with it etc. Help us have an overall picture beyond the words. Need to see your Whole flow we I can recommend what to do.

     

    1. Does the text have carriage turns in it?

    2. I understand you want to put the base text into Salesforce, but can you explain why you care about the space?

    I guess you can always put them back in, which sucks if you have too but you can.

     

    3. Are you converting stuff into a Table so it doesn't look like garbage?

    4. What exactly are you putting in the email.

     

    Etc.

     

    Please share more details and what you would like.

     

     

  • DH2023 Profile Picture
    84 on at

    Thank you for the reply.  I have multiple scopes which are each doing it's own thing but for example the step in the screenshot below is returning the value after Start Date:  Below is an example of the email received.

     

    DH2023_0-1721137735056.png

     

    So for example, when trying to get the start date, I am using  trim(split(outputs('Email_Plain_Text'), 'Start Date: ')[1]) and trim(split(outputs('splitAtStartDate'), 'Job Code:')[0])

     

    DH2023_1-1721137875264.png

    I am also adding line breaks that should help with the breaking of the lines coming from the HTML to Text output, but it still seems to be breaking the lines and making everything a run on sentence in theory. 

     

    Wanted to see if there was an expression I could use that would combine these. 

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!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 557

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 264 Super User 2026 Season 1

Last 30 days Overall leaderboard