cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

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 II
Dual Super User II

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!

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

 

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!

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.

New Member

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

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (21,015)