Hi @Anonymous ,
What’s the error message you’ve got on your side?
Could you share more details on the functions?
What’ the format of the email body?
You mentioned that Html to text action adding random break lines, how is it displayed?
According to your description, I guess that you want to extract contents from the email body. I have made the following test for your reference.
The email is formatted likes below:

Trigger the flow by When a new email arrives, then the action Html to text.
To get Name, use the following code:
substring(body('Html_to_text'),add(indexOf(body('Html_to_text'),'Name'),5),sub(indexOf(body('Html_to_text'),'Date'),add(indexOf(body('Html_to_text'),'Name'),5)))
Using the following statement to get the Date:
substring(body('Html_to_text'),add(indexOf(body('Html_to_text'),'Date'),5),sub(indexOf(body('Html_to_text'),'Comments'),add(indexOf(body('Html_to_text'),'Date'),5)))
The similar configuration for the Comments:
substring(body('Html_to_text'),add(indexOf(body('Html_to_text'),'Comments'),9),sub(length(body('Html_to_text')),add(indexOf(body('Html_to_text'),'Comments'),9)))
Images for your reference:


Best regards,
Mabel