Hello all,
This is the first time I am trying to do a Power Automate flow and I am struggling with it.
So the flow would go like this:
Trigger: "When a new email arrives (V3)"
- Set up email filtering based on my requirements (Namely if the subject of the email starts with ECAB)
Condition 1: Check if the email subject starts with "ECAB"
- Yes branch:
- Compose: Extract the email body
- Action: "Post a message as the Flow bot to a Teams channel"
- Fill in the required fields using the dynamic content and expression
- No branch:
- Condition 2: Check if the email subject contains "FW: ECAB" or "RE: ECAB"
- Yes branch:
- Compose 1: Extract the Message ID
- Compose 2: Clean Message ID (replace(outputs('Compose_1'), '\r\n', ''))
- Action: "Reply with a message in a channel"
- Fill in the required fields using the dynamic content and expressions and updates the message on teams (namely updates the conversation with the data from the RE: or FW: email)
- No branch:
- Action: "Send an email (V2)"
- Send a formatted email to the user notifying them of the incorrect format
On Power Automate looks like this:

But I am having issues with the Yes Branch of the Condition 2.
On that branch I have a compose called Extract Message ID with:
Inputs: split(triggerOutputs()?['body/text'], 'Message ID: ')[1]
And another compose called Clean message ID with:
replace(outputs('Extract_Message_ID'), '\r\n', '')
After that I have a Reply with a message in a channel that I have filled with the data I wanted plus on the "Message ID" I have chose the output of Clean message ID and the message being:
<p>Email Content: @{triggerOutputs()?['body/text']}<br><br>Please click on the link to the email in Outlook Web App to review<br></p>
Then I save and test... and get this error:

Does anyone knows what I am doing wrong? and could you help me please?
Thank you in advance.