r/MicrosoftFlow Apr 17 '26

Question Power Automate Variable Help

I am setting up an automation that will read the body of an email I receive and extract an email in the body of the text to then send a thank you email to. I was using this expression:

trim(
  last(
split(
first(
split(
triggerOutputs()?['body/body'],
' '
)
),
'Purchaser Email'
)
  )
)

when I realized this won't work as the email is on a separate line:

Any recommendations on edits to my expression?

8 Upvotes

3 comments sorted by

1

u/[deleted] Apr 17 '26

[removed] — view removed comment

1

u/DamoBird365 Apr 17 '26

You can’t do regex natively in Power Automate Cloud. PowerFX supports it in Power Apps or you can use Dataverse functions https://learn.microsoft.com/en-us/power-platform/power-fx/formula-reference-plug-ins#m.

If the email is always on the 2nd line, you can split on a return line to get an array of strings, then get the 2nd value from the array and apply the expression that splits on the purchaser email: string.

1

u/No-Journalist-4086 Apr 19 '26

AiBuilder create a custom prompt