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 / Perform an action base...
Power Automate
Unanswered

Perform an action based on a substring in an email subject

(0) ShareShare
ReportReport
Posted on by 2

I am relatively new to Power Automate. I try to move an incoming email to a specific folder based on a sub string within the email subject. I tried to use the switch function using the contain function (contains(triggerOutputs()?['body/subject'])), but it doesn't work.

 

Any help is appreciated. Thanks

Categories:
I have the same question (0)
  • Sundeep_Malik Profile Picture
    6,484 on at

    Hey @m0w 

    To use contains you will have to match your subject to something. So, you can keep your folder names in a compose, in an array of string. For example: 

    A, B and C are your folders, then in the compose write ["A","B","C"]

    Then store the subject of the current email in a compose.

     

    Sundeep_Malik_0-1663235399381.png

     

     

    After this use an apply to each, and give the output of folder's compose in the option field of apply to each. Inside this use a condition action. In the condition use 

    contains(triggerOutputs()?['body/subject'],items('Apply_to_each'))
    and match it to true. When this does, save the mail to the required folder. 

     

    Sundeep_Malik_1-1663235513213.png

    I hope this helps. 

  • m0w Profile Picture
    2 on at

    Thank you, i think I understand it, but i think this doesn't apply to my case.

    The folder names are different from the sub strings in the subject line that i am looking for.

     

    e.g., if the subject contains 'GP', move the email in folder Inbox/XX/YY. If the subject contains 'QY', move the email to folder inbox/XX/ZZ.

     

    All this in parallel to save the attachment on sharepoint, so i start using a  'When a new email arrives in a shared mailbox (V2)

    But that part works well for me

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