I recently encountered a scenario where I had to extract multiple lines of text from a system generated email using Power Automate. The key to this Flow pattern is the predictability of the system generated message, meaning I can count on line 1 always being line 1 and line 2 always being line 2 etc. The Flow was difficult to create but simple in its final implementation using Html to text and Compose actions.
In the image below we can see my system generated email. Our Flow will extract lines 1-4.

I am using an Automated cloud flow with the When a new email arrives (V3) trigger. I am using the “Subject Filter” to specify the conditions by which the Flow will execute. In this case any email with a subject of “System email message” will trigger the flow. The context of the trigger is based on the account defined in the connection, i.e. my inbox.

Next, I add an Html to text action and set the content to Body from the When a new email arrives (V3) trigger.

The Html to text action converts the email body (A) into readable and usable content (B).

Using a Compose action with an expression we extract our target text line.

The expression code is listed below and generally reads as:

Yellow: Replace the hidden line break characters with a pipe symbol using decodeUriComponent(‘%0A’)

Green: Split Yellow based on the pipe symbol.

Purple: Extract the first line ([0]).

Expression code:
split(replace(outputs('Html_to_text')?['body'], decodeUriComponent('%0A'), '|'), '|')[0]
Additional Compose actions are added for each line to be extracted with the only change being the array location value i.e. [1], [2], [3].
split(replace(outputs('Html_to_text')?['body'], decodeUriComponent('%0A'), '|'), '|')[1]
split(replace(outputs('Html_to_text')?['body'], decodeUriComponent('%0A'), '|'), '|')[2]
split(replace(outputs('Html_to_text')?['body'], decodeUriComponent('%0A'), '|'), '|')[3]
My completed Flow looks like the image below.

I’m sure there are more elegant ways of performing this operation, but it suits my needs and the value it adds outweighs any risk of refactoring if the system generated email ever changes. In my production version of this Flow, data is written to Dataverse for review and action as part of a larger business process and has error handling to let me know if things fail.
Thanks for reading!
NY