Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
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,
  • DH2023 Profile Picture
    84 on at
    Re: Parsing Text Expression

    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. 

  • Michael E. Gernaey Profile Picture
    43,399 Super User 2025 Season 1 on at
    Re: Parsing Text Expression

    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.

     

     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492