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 / Adding new items to li...
Power Automate
Answered

Adding new items to list from excel but need to skip items if already exist and match excel row

(0) ShareShare
ReportReport
Posted on by 1,599 Super User 2024 Season 1

Hello,

 

In this workflow I am adding plain xlsx file to a SharePoint document library.

Once the file is added, I am using the "Create table" action to add a table to the document.

Then I use a 60 second delay action to allow time for the table to be added.

 

sudosaurus_0-1637838353437.png

Next I use the "List rows present in a table action" with the Filter Query of Title ne '' to stop blank rows from being added to my SharePoint list (futher down). 

sudosaurus_2-1637838451764.png

Next I use the Apply to each action to grab the value from the previous step (List rows present in a table).

I then use the Get items action to bring back the values of items already existing in a SharePoint list.

Next I add another Apply to each action with a Condition where it checks whether the "EmployeeID" column in the SharePoint list matches the data from the EmployeeID column in the excel file.

 

sudosaurus_3-1637838532604.png

If the data matches (If yes) then do nothing and if it doesn't match (If no) then add new content to the SharePoint list.

sudosaurus_4-1637838585180.png

 

I tested this workflow first before addition in the conditional actions to check that data can be populated to the SharePoint list from the Excel file and this worked perfectly.

 

However my next action is to do the conditional checking, however this is not working correctly and is just creating many duplicates in the SharePoint list instead.

 

Any pointers to what I may be doing wrong?

 

 

Categories:
I have the same question (0)
  • Verified answer
    miguelcas Profile Picture
    Microsoft Employee on at

    Hi @sudosaurus 

     

    Here is a way to do the filter that you want. Please see the images and instructions to follow how to avoid existing data in the SharePoint list and then creating just the new items. 

     

    1. Just using one apply for each, we are going to filter the data in the Get items action 

        

    miguelcas_0-1638464075270.png

    What I'm doing here is just getting the item that matches with an ID from the List rows in table output, this is to know if an item is already in the SharePoint list. Take a look of the filter query. 

     

    2. Then, add a condition were we want to know if the Get items action get a row. If the length of the output equals 0 create the new item. If its not equal to 0 it means that we already have an item in the SharePoint List. 

     

    miguelcas_1-1638464740792.png

     

    Note: here the expression to get the length 

    length(outputs('Get_items')?['body/value'])
     
    Let me know if I can help you with something else. 
     
    Thank you for using Microsoft Power Platform Communities.
    Community Support Team - Miguel Castro.
    If this Post helps, then please consider Accept as solution to help the other members find it more quickly.

     

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    Hi @miguelcas ,

     

    Thanks for your response however this doesn't seem to be working for me.

    It is failing on the condition action:

    sudosaurus_4-1638650062522.png

     

    Flow details:

     

     

    sudosaurus_0-1638649823771.png

    sudosaurus_1-1638649913950.png

    sudosaurus_3-1638649998378.png

     

     

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    Hi @miguelcas 

     

    Seems to be working now. Played around with the settings and now working correctly! 🙂

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 711

#2
Vish WR Profile Picture

Vish WR 691

#3
Haque Profile Picture

Haque 525

Last 30 days Overall leaderboard