Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Daily excel to SharePoint list adding feature that avoids duplicates

(2) ShareShare
ReportReport
Posted on by 31

Hello everybody!

Thank you in advance for your help.

 

I would like help improving my flow below.

I receive an excel file with a table daily via Email. I have a flow that dumps that into a SharePoint folder which is where this flow comes in. 

Unfortunately due to the nature of the data there are many repeats between the days.

The data contains a column "App" that is a unique identifier. I would like for the flow to only add the data to my SharePoint list if the value does not already exist. Alternatively if it replaced the row I would not mind. Essentially I just don't want duplicates in my SharePoint list. I am open to any way to avoid this.

 

Bonus points if there is a way to add in a delete file so after the data has been extracted from the excel file it is deleted.

 

Thank you!

 

RecFi_Analytics_0-1656633277092.png

RecFi_Analytics_1-1656633298691.png

RecFi_Analytics_2-1656633325310.png

 

 

  • ThommyPrez Profile Picture
    43 on at
    Daily excel to SharePoint list adding feature that avoids duplicates
     
    I have used your information and my flow work very good,
    I desire after "create item" and before "delete file" another control for delete items in SP list not present in exel table.
    Check if APP value is present in SP LIST but is NOT present in excel table (APP column), delete this row.
     
    Can anyone help me?
     
     
  • RecFi_Analytics Profile Picture
    31 on at
    Re: Daily excel to SharePoint list adding feature that avoids duplicates

    **

    EDIT: SOLVED!

    I had a few issues on my end including a hidden space in a column title that were stopping me. Once fixed this flow worked absolutely perfect. Thank you so much you are a life saver.

    **

     

    @v-peijunz-msft 

     

    Thank you again. I did some digging regarding sharepoint lists and solved my column name issue I mentioned.

     

    While my flow is running successfully it is going to the 'no' condition and no values are being created in the sharepoint list.

    There are many new values that need to be added in the excel sheet.

     

    Please let me know if you have an idea what may be happening. I can send you files as well if this helps but your test data looks like it should serve the purpose.

    RecFi_Analytics_0-1657128346549.png

    RecFi_Analytics_1-1657128454192.png

     

     

  • RecFi_Analytics Profile Picture
    31 on at
    Re: Daily excel to SharePoint list adding feature that avoids duplicates

    @v-peijunz-msft 

     

    Thank you so very much for taking your time to help me!

     

    Initially I had responded that I was getting an error but it was due to my own mistake.

     

    It seems everything is good although I keep getting an error that my 'App' column does not exist. I recently changed the name of the column in my list and believe it may not have taken effect yet. I will try again later this evening and tomorrow to see if the list has been updated and will make your response as a solution if all is good.

     

    Thank you again!

  • Verified answer
    v-peijunz-msft Profile Picture
    Microsoft Employee on at
    Re: Daily excel to SharePoint list adding feature that avoids duplicates

    Hi @RecFi_Analytics ,

     

    You could use a Condition action to avoid duplication in SharePoint list.

    Based on your description, I have made a simple test for your reference.

     

    1. Here is my flow.

    It is supposed that the data structure and table name of the excel file we receive every day are the same. That is the prerequisite of this flow.

    In the flow, using Filter Query to identify the existing items.

    length(outputs('Get_items')?['body/value'])
    items('Apply_to_each')?['Column Name']

    vpeijunzmsft_10-1657091014854.jpeg

    vpeijunzmsft_0-1657090436845.png

    vpeijunzmsft_1-1657090436857.png

    vpeijunzmsft_2-1657090436866.png

    2. Delete the file after the data has been extracted:

    Uri:

    _api/web/GetFileByServerRelativeUrl('/sites/YourSiteName/YourFilePath')

    Headers: 

    Prefer
    bypass-shared-lock

    vpeijunzmsft_3-1657090436869.png

    Result Screenshots

    1). Here is my excel table:

    vpeijunzmsft_4-1657090436870.png

    And my SharePoint site list:

    vpeijunzmsft_5-1657090436871.png

    After running the flow, my list:

    vpeijunzmsft_6-1657090436873.png

    2).  Delete file action:

    a. Before

    vpeijunzmsft_7-1657090436874.png

    b. After

    vpeijunzmsft_8-1657090436875.png

     

     

    Best regards,

    Sylvia

     

     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1