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 / Forward an email from ...
Power Automate
Answered

Forward an email from a shared mailbox if certain words are matched in the subject line

(0) ShareShare
ReportReport
Posted on by 13

Hi all,

Flow newbie here.

 

I'm trying to build a flow that forwards a copy of an email from a shared mailbox to a specific person, when certain keywords in the subject line of the email are met.

It works fine when I only have one word as criteria, like this:Condition.png

However, if I add now more of the 'default' subject line, for example, B2B RFQ, Some Company name, then it will not run.

I have also tried this setup:

ANDFunction.png

I'm no good with expression, but I tried those as well, with no success.

Any tips & tricks would be greatly appreciated.

 

Thank you guys

Categories:
I have the same question (0)
  • tom_riha Profile Picture
    10,185 Most Valuable Professional on at

    Hello @Mike19 ,

    place the test inside string() expression. That way you tell the condition that the whole string, including the spaces, is the string to look for.

    string('some company name')

     image.png

  • mjburley Profile Picture
    370 on at

    I think you need OR rather than AND, so ensure your top group AND is OR.

     

    mjburley_0-1607963962738.png

     

  • Mike19 Profile Picture
    13 on at

    thank you @tom_riha, I tried it with the original subject line from the email, which looks like this:

    string('Some Company Name & Something Comp'), but the result was 'False' and the email was not sent.

  • Mike19 Profile Picture
    13 on at

    Hi @mjburley ,

    Thank you for your suggestion, same result, Expression result is 'false' and no email was sent...

     

  • mjburley Profile Picture
    370 on at

    Can you add screenshots of the flow run to help diagnose?

  • Mike19 Profile Picture
    13 on at

    Hi @mjburley 

     

    Certainly, my apologies,

     

    Here is what I have under the conditions:

     

    Conditions.png

     

    and then the if 'Yes' is met:

     

    IfYes.png

    Problem is now, that everything that has B2B in the subject line, is being forwarded ....

  • Verified answer
    Mike19 Profile Picture
    13 on at

    Hi everyone,

    I think I may have the solution:

     

    possiblesolution.png

  • rcoveyduc Profile Picture
    2 on at

    Hi Mike,

     

    Can you show what you did higher up in the flow? These steps to set up the controls are logical, but the forwarding piece isn't happening for me when I run it. As far as Power Automate is concerned, the flow ran successfully and there are no flow errors. I suspect my issue is higher up. I've attached a picture of the trigger, one of my controls, and the if statement. email addresses have been removed for confidentiality. I have seven controls, all set up like this. When run, the flow gives the check mark on all. I feel like it's an issue with the subject filter field in the trigger. I'm trying to figure out what action to put between it and the controls because I can't put anything dynamic in that field. Thanks.PA_inquiry.png

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard