web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Left function with var...
Power Automate
Answered

Left function with varying lengths

(0) ShareShare
ReportReport
Posted on by

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 ReportNorthwest Ops

 

I've tried this, but the expression is invalid

left(triggerBody()?['subject'],find("-",triggerBody()?['subject'])-1)

 

Any help would be greatly appreciated. 

Categories:
I have the same question (0)
  • Verified answer
    Ajinder31 Profile Picture
    530 on at

    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.

  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard