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 / Problem when building ...
Power Automate
Unanswered

Problem when building a flow to forward all sent emails

(0) ShareShare
ReportReport
Posted on by

Hi, I want to build a flow to forward all sent emails to another email address (gmail) so that I can have a backup. Here are the triggers that I used:

 

When a new email arrives (V3)

   Folder - Sent items

Forward an email (V2)

Mark as read

 

The problem is after I sent an email, it keeps forwarding that email to my gmail again and again and it won't stop. I ended up receiving 100+ emails in a min. I can't find a trigger that can stop the process. 

 

Any solution please? Thank you. 

 

Screenshot 2019-11-29 at 2.28.46 PM.png

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Anonymous 

     

    The flow that you have currently is whenever a new email arrives in your sent mail box, you are forwarding it to your gmail. Note that, this will add an email (the forwarded one) to your sent mailbox and trigger the flow again and thereby creates a never ending loop. 

     

    To address this, what you can do is, add a trigger condition to flow saying not to trigger when the email is sent To your gmail. You can follow this blog here to setup the trigger condition. 

     

    https://www.bythedevs.com/post/working-with-trigger-conditions-in-ms-flow 

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • Community Power Platform Member Profile Picture
    on at

    @yashag2255 Thanks for your response. 

     

    My question is I know nothing about coding. It seems like I need to first identify some relevant fields in the flow run history for this expression:

    @not(equals(last(split(triggerBody()?['From'],'@')),'testdomain.onmicrosoft.com'))

    I tried to look into the code of the trigger but had no clue what I had to do ... could you please guide me through this process?

     

    Thank a lot! 

     

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    hey @Anonymous 

     

    Can you try this: 

     

    @not(equals(triggerBody()?['To'],'test@gmail.com'))
    

     

    Replace that email with your gmail. 

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • v-alzhan-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    Have your problem be solved?  If yes, please go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

     

    Best Regards,

    Alice

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Community Power Platform Member Profile Picture
    on at

    @yashag2255 Thank you for helping me out, but the email loop is still there after using the expression. 

  • mmiller108 Profile Picture
    2 on at

    @Anonymous I know this is an old thread, but here's the solution I found. (in case anyone who stumbles on this thread is interested)

     

    This should work as the trigger condition to prevent the infinite loop per the OP problem, where 'forwardingAddress@email.com' is the email address you are forwarding to.

    @not(equals(triggerBody()?['toRecipients'],'forwardingAddress@email.com'))

     

    This is also equivalent:

    @not(equals(triggerOutputs()?['body/toRecipients'],'forwardingAddress@email.com'))

     

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