excelsharepointpower-automate

Power Automate - Compare SharePoint List with Excel file and delete existing values


I have an Excel file that has a single column; let's call this MemberName. I have a SharePoint List, with a single column, that I want to update using the Excel file. I am intending to loop through the values in the SharePoint column, compare these to the Excel column, and delete the SharePoint values if they match (i.e. delete 'Aaron' from SharePoint if 'Aaron' is found in Excel).

Per the following, I have tried starting the loop on the SharePoint list ("value" output from Get Items). I've then nested a loop to iterate over "value" output from List rows present in a table.

The condition takes "items('Apply to each')" and checks if it is equal to "items('Apply to each 2')" - I think that this bit is OK.

[Screenshot]()

The condition output aspect should then get the ID of the current SharePoint value, and then pass this to the Delete item function. I can't get this to work at all (the loop seems to go on forever...)


Solution

  • You can try to put "Get Item" action before "Apply to each 2" action.

    My demo for your reference: enter image description here

    My Demo result:
    Excel data

    enter image description here

    SharePoint List data:

    enter image description here

    After running the flow, the list is like:

    enter image description here