web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Duplicate Entry in Exc...
Power Automate
Suggested Answer

Duplicate Entry in Excel Table from Power Automate

(1) ShareShare
ReportReport
Posted on by
In power automate, I am using JSON results from an API to enter data into an excel sheet. I need to use different endpoints to get all the data to fill the sheet which is an excel template. 
 
The issue here is my flow sometimes enters duplicate data into the excel. 
 
In the images below, the flow looped 6682 times but I have 6684 records in my excel table but 6685 with the header. I have verified that 2 records repeated themselves once. I have a retry policy on the Add row to excel action. I am not sure if that is what is causing the problem.  Any help will be appreciated. 

I am not happy I have to loop 6682 times of a json. Any ideas will be appreciated either to prevent the multiple looping which eventually solves the duplicate record or just how to prevent the duplicate records. It works fine sometimes and other times it decides to duplicate. 

Thank you.
 
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,958 Moderator on at
     
    Hehe think of us at mechanics. essentially you have to bring the car too us if you want help.
     
    We need to see your flow; we need to see a flow run where something was duplicated. A re-try while possible, should not duplicate the data, unless an error happened post (write) but before it did the next loop.
     
    In that case, you should turn off retries and find out exactly what item is failing and being retried.
     
    If you want help, you have to bring the car
    1) your flow with inputs in design mode
    2) a flow run where we can see the inputs and outputs
    We would potentially have to look through 6682 loops to find the one that "may" have been duplicated.
     
    I would recommend this, and it will help you in the future 
     
    Inside your loop that I assume you have, let's pretend you only have a single action (add row to a table). Do this please. Now you can share everything first and hopefully we can help but this will help you.
     
    1. Add a scope and rename it try
    2. Add two parallel scopes renaming them catch and success do nothing
    3. Add a Send Email where you will email yourself the details of the Row you were trying to add but failed
    4. Change the Add a Row to a table to turn OFF retries (set it to none)
    5. In the catch Scope, click ... and change the Run After Settings to Error/Skip and Timeout
    6. in the Success Do Nothing click ... and youll see it already says Success so just leave it
     
    Now return the flow that caused you to have duplicates. and I do mean, open that run up, and re-submit it
    it will now follow this pattern and we can figure out which one or ones are failing
    AND get an email
    And you can validate how many records are in the table now.
    P.S. make sure the table has no rows.
     
    Make sure you do not have any set Variables etc inside an Apply to each.
     
    Do this one time and we should be able to isolate the issue better.
     
     
  • Suggested answer
    rzaneti Profile Picture
    4,476 Super User 2026 Season 1 on at
    Hi @CU25022228-0,
     
    Actions are API calls behind the scenes. When you have an action inside a loop, it will make one individual API call for each of the loop iterations, and eventually reach some limits or retrieve some errors.
     
    An alternative to prevent the looping (and consequently the errors) is to add these records in a bulk to your table, which you can achieve by using a Graph API request or an Office Script (which is like a VBA that integrates fine with Power Automate). I find the second option particularly easier, but the Office Scripts sometimes aren't allowed by the organizations. Another two downsides are that (1) you may need some knowledge in TypeScript and (2) your Script must necessarily be executed in no more than 120 seconds.
     
    Here are some contents that I created about Office Scripts, which can be helpful to clarify how does this feature work.
    - Sending values from Power Automate to Excel with Office Scripts: https://digitalmill.net/2024/01/17/sending-values-from-power-automate-to-excel-with-office-scripts/
    - Video: Writing data into Excel ranges (outside of tables) with Power Automate and Office Scripts: https://youtu.be/-OGYQEQSP-0
     
     
    If the Office Scripts approach works for you and you need some help to craft the code, we can help :)
     
    Let me know if it works for you or if you need any additional help!
     
    If this is the answer to your question, please mark the post as Accepted Answer.
    If this answer helps you in any way, please give it a like.

    Check more Power Platform content on my website.
    Lets connect on LinkedIn.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 1,027

#2
Valantis Profile Picture

Valantis 815

#3
Haque Profile Picture

Haque 630

Last 30 days Overall leaderboard