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 the email base...
Power Automate
Unanswered

Forward the email based on country code on the subject line of the email to list of people on an excel list for that country

(0) ShareShare
ReportReport
Posted on by 37

I have a list of countries and the respective coordinators' email address for each country in a spreadsheet. Each person can be responsible for more than one country.

There is an automated email that gets triggered from eservices to a service account in outlook.

Using power automate, I want capture the country's name on the subject line of the email and forward the email to the respective country coordinators using their email address.

How do i do it?

Categories:
I have the same question (0)
  • Verified answer
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @power13 

     

    Pls refer the sample flow as mentioned below.

     

    Here, I have uploaded the excel sheet on SharePoint library that contains the mapping of country & coordinator. The sheet has a table that holds the required records:

    ManishSolanki_0-1694523437895.png

     

    Flow:

    1. Firstly, add "When an email arrives" trigger that is the starting trigger for the flow. After this trigger action, we will add "List rows present in table" action to get the records for country coordinators:

    ManishSolanki_1-1694523666440.png

     

    2. Next, we will iterate excel records and will compare the country name in the subject line of the received email. Add "Apply to each" action for iteration and "Condition" action for comparison purpose. The Condition action needs to be added inside the block of "Apply to each" action:

    ManishSolanki_2-1694523850953.png

    All these fields can be selected from the "Dynamic content" window as shown for subject field.

     

    3. Finally, if we find the name of country in the excel file then using "Forward an email" action, we will forward the received email to the respective coordinator. This action will be added inside the "Yes" block:

    ManishSolanki_3-1694523995889.png

    'Message Id' & 'Coordinator' fields can be selected from the dynamic content.

     

    I hope this flow will give you some idea to design the desired flow 🙂

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • Verified answer
    power13 Profile Picture
    37 on at

    Dear Manish,

     

    This is brilliant and it worked like a magic. However, it keeps going in a loop and the emails keep coming for the same subject and I had to turn off the flow to stop. Where did it go wrong? And I would also like to have the email sent from another email address and not mine, is it possible?

     

    Grateful for your guidance!

     

    Thanks,

    Raam

  • Verified answer
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi Raam

     

    I am glad that the sample flow was helpful for you 🙂

     

    If you are forwarding the email to yourself then flow will trigger in a loop, to avoid it update the trigger's connection to run under service account or an account who is not a coordinator. It may again execute in the loop if you configure any country coordinator's connection in outlook connector:

    ManishSolanki_0-1694569373571.png

     

    Similarly, if you want to update the sender of the forward email, then you need to update the connection as shown below:

    ManishSolanki_1-1694569462487.png

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • power13 Profile Picture
    37 on at

    Hi Manish,

     

    Yes, I was sending test emails to myself and it went on a loop. Rookie mistake!

     

    I will try adding a new connection and give the service account email address from where the email has to be sent out.

     

    Thank you again for your help!!

     

    Regards,

    Raam

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

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard