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,