I'm trying to replicate the effect of this formula from excel "LEFT(B5,FIND("-",B5)-1)" in Power Automate, where instead of cell B5 I'm referencing the Subject line of an email.
My trigger is every time an email is received from specific senders, I want to salvage only the left hand portion of the subject line, after a specific character, but with the left hand side being varying lengths. For example:
C-Suite _ Monthly Sales report | C-Suite |
Northwest Ops _ Volume Report | Northwest Ops |
I've tried this, but the expression is invalid
left(triggerBody()?['subject'],find("-",triggerBody()?['subject'])-1)
Any help would be greatly appreciated.
Hi @Anonymous ,
The point is that '-' is not a valid operator in flow , please use 'sub' instead.
left(triggerBody()?['subject'],sub(find("-",triggerBody()?['subject']),1))
Best Regards,
Bof
Hi @Anonymous , If requirement is to get text before first underscore _ I think below expression will work fine.
split(triggerOutputs()?['body/subject'], '_')[0]
--------------------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
stampcoin
97
Michael E. Gernaey
70
Super User 2025 Season 1
David_MA
48
Super User 2025 Season 1