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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Forwarding email based...
Power Automate
Answered

Forwarding email based on keyword stored in Sharepoint list

(0) ShareShare
ReportReport
Posted on by 60

Hi All

 

I have a SharePoint list that contains two columns

 

Keyword, UserEmail

 

When a new email arrives into a shared mailbox, i would like to have the email body searched for any of the keywords found. If there is a match then the email is forwarded (as an attachment) to the associated user email.

 

Is this possible? Does anyone know how to achieve this?

 

TIA

Categories:
I have the same question (0)
  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @Bigshow 

     

    I have just built a wee proof of concept on the assumption the subject must match 100%.

     

    You can filter in the get items action and if a result is returned i.e. length of result is greater than 0, send an email.

     

    List:

     

    DamoBird365_0-1617133344714.png

     

    Flow:

     

    DamoBird365_1-1617133370089.png

     

    Just realised the screenshot misses out the filter... here it is:

    DamoBird365_0-1617133531806.png

     

     

    Hope that is visible and works for you?

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here

     

  • Bigshow Profile Picture
    60 on at

    Thanks but I don’t think I explained myself quite right.

     

    so when a new email arrives I would like the body of it scanned for any of the keywords contained in the Sharepoint list. If there is a match then I would like the email forwarded (as an attachment) to the email address associated with the matching keyword

     

     

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @Bigshow 

     

    Late night last night and I see I didn't read it right, apologies.  You could achieve this in a similar way using an apply to each on all of the returned rows from get items.  No need for a filter.

     

    Within the apply to each you can use indexof expression on each of the key words on the body and then if a number is returned, you know the word exists in the body.  Otherwise - it doesn't.

     

    Hope that makes sense.

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here

  • Bigshow Profile Picture
    60 on at

    Thank you 

     

    would it be possible to produce a sample workflow?

  • Verified answer
    DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @Bigshow 

     

    This worked for me:

    DamoBird365_0-1617171981523.png

     

    When I run this on my newly received email it contained one of the words.  The apply to each looped 3 times and once branched down the yes.

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here

  • Bigshow Profile Picture
    60 on at

    Thanks

     

    I have tried to copy these steps, but im having problems with the Indexof(). The dynamic's are not appearing for me to place in the indexof() expression. I cant see what im doing wrong

     

     

    Bigshow_0-1617178534630.png

     

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @Bigshow 

     

    It won't.  You will need to build it up.

     

    Here is a copy of mine 

    indexOf(triggerOutputs()?['body/body'],items('Apply_to_each')?['Subject'])
    Make sure you update Subject with the name of your column.
     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here

  • Bigshow Profile Picture
    60 on at

    Thank you

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard