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 / When new email arrives...
Power Automate
Answered

When new email arrives (V3) triggered flow to run twice instead of once

(0) ShareShare
ReportReport
Posted on by 13
Hello folks,
 
I'm encountering an issue where my flow is creating two new different rows in my Excel sheet when it should only create one new row. The flow is triggered by an email with one PDF attachment and should only run once daily. Interestingly, the two new rows contain different values.
 
**Flow Overview:**
1. Trigger: When a new email arrives (V3) with a PDF attachment and specific subject line
2. Delay: 1 minute
3. Process: Use AI Builder document processing to extract data from the PDF
4. Output: Insert a new row into an Excel sheet (stored in SharePoint)
 
**What I've Tried:**
1. Duplicated the flow and turn off the old flow - issue persists
2. Removed and reconnected all connections - issue persists
 
**Important Notes:**
- Manual test runs work correctly (creates single row as expected)
 
**Questions:**
1. Could the loop be causing this duplicate row issue?
2. Why would the rows contain different values?
 
Below are screeshots of my flow and also the parameters I've set for each steps. 
Any insights would be greatly appreciated!
 
 
 
 
 
 
 
 
Categories:
I have the same question (0)
  • Verified answer
    Mark Nanneman Profile Picture
    991 Super User 2025 Season 2 on at
    First, you don't need your delay in a loop.  I'd move it out of the loop directly under the trigger (if you need it at all)

    I'm assuming your loops are all taking the attachments array from the email as their input, if this is the case you don't need multiple loops, put everything inside one loop and delete the others.

    Again, assuming your loop is based on the attachments array on the email, the reason it contains more than one iteration and creates more than one row in your sheet is most likely because your email actually has additional attachments.  Frequently, an image that is embedded in the email has an associated hidden attachment.

    E.g. this email I sent myself from gmail has an embeded picture and a pdf attachment.  Only the PDF shows as an attachment in Outlook.

    But if I look at the output of the "when a new email arrives (v3)" in the flow run, I see two attachments.
    The "hidden" attachment is for the image file, and its "isInline" property is set to "true" because it's in the message body.



    Check your flows trigger outputs on recent runs.  If the additional attachment(s) are image files, I'm not sure why your Extract isn't failing.  Perhaps it's just returning nulls, blanks or junk data for the second attachment?

    The solution would be to filter your attachments from the email so that you're only running the PDFs. 

    You could do this with a condition in your loop.
    Something like  "item()?['name'] ends with 'pdf'"



    Or the best way would be to use a filter on the array and then loop on the output of this filter.





    If this helped you, please click "Does this answer your question" and give it a like to help others in the community (+ close the ticket)!

    Power Platform Developer | LinkedIn: Mark Nanneman | Blog: Power Stuff  | YouTube: Mark's Power Stuff  

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 378 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 273 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 135 Most Valuable Professional

Last 30 days Overall leaderboard