cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kenckyuen
Level: Power Up

Problem when building a flow to forward all sent emails

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

5 REPLIES 5
Dual Super User
Dual Super User

Re: Problem when building a flow to forward all sent emails

Hi @kenckyuen 

 

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!

kenckyuen
Level: Power Up

Re: Problem when building a flow to forward all sent emails

@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! 

 

Dual Super User
Dual Super User

Re: Problem when building a flow to forward all sent emails

hey @kenckyuen 

 

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!

Community Support Team
Community Support Team

Re: Problem when building a flow to forward all sent emails

Hi @kenckyuen ,

 

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.

kenckyuen
Level: Power Up

Re: Problem when building a flow to forward all sent emails

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

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (5,161)