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 / How to extract the dif...
Power Automate
Unanswered

How to extract the difference between two tables or lists

(0) ShareShare
ReportReport
Posted on by

Hello all,

I would like to compare Excel (table) in Sharepoint with a Sharepoint list, add data that is only in Excel to the Sharepoint list, and delete data that is only in the Sharepoint list. I would like to add and delete items regularly.
I built the flow below, but the data that is in both Excel and the Sharepoint list is added to the Sharepoint list.

Also, when I tested it, it didn't finish deleting items.
Could you please tell me the solution?

 

231213-01.png

 

 

 

 

 

 

 

 

 

 

231213-02.png

Categories:
I have the same question (0)
  • DexPoint Profile Picture
    191 on at

    Hi Patricia11,

    When you say "add data that is only in Excel to the Sharepoint list, and delete data that is only in the Sharepoint list. I would like to add and delete items regularly."

     

    do you mean a single field like one column / cell from Excel to a field mapped to Sharepoint List? 

    Or


    Do you want to add a record (A complete set of data) to sharepoint list.

    Please confirm because these would be two different things in comparing data fields to fields vs seeing if an entry Record exists.

  • Patricia11 Profile Picture
    on at

    Hi @DexPoint ,

    Thank you for your reply.

    I want to add a record (a complete set of data) to a SharePoint list.

    Thank you in advance.

  • DexPoint Profile Picture
    191 on at

    I'll explain what i've done while updating records or creating files and hopefully it can help you.

    I would list rows in your excel table. then i would filter the array,  in the excel table i would add a column that says "Add to Sharepoint List" then when its blank you have the action add the item to sharepoint list.  if its not blank ir gets filtered out. Then id have a second column that would be "Delete from sharepoint list" and i would use the another filter to determine if that should be deleted.

    In the sharepoint list you would look for the key column / field and update or delete that specific row. (Set visibility based on deletion indicator vs actually deleting it)

     

    Here is a small snippit of one ive made where i essentially said.  Column 24 should not be empty and column 26 should be empty.  

    When the flow finds a record that is blank in "Add to sharepoint list" then it reads the json and populates them in sharepoint list, after doing this have another action "Update a row in a table" and update column 26 with "complete" so that it knows this particular flow has updated this work.


    So in your case you could have a flow for adding of records and one for deletion of records. 

     

    the first thing would be to add the column and set the filter, then update all the records manually so its baselined that any new lines are added.  then when you want one removed you can use the column as a "Removal indicator" i'm not sure if the delete option is good for you as its field based vs comparing if a record exists or not.

     

    DexPoint_0-1702551952505.png

     

     

    I hope this is at least a little bit helpful, but generally speaking i like to add markers to data vs deleting it completely.

     

  • Patricia11 Profile Picture
    on at

    Hi @DexPoint , 

    Thank you for your reply.

     

    I was able to list the rows of an Excel table, filter the array, and add a column called "Add to Sharepoint List" to the Excel table.

     

    However, since I'm not familiar with power automate, I am having trouble building a flow for the "when its blank you have the action add the item to sharepoint list. if its not blank ir gets filtered out. Then id have a second column that would be "Delete from sharepoint list" and i would use the another filter to determine if that should be deleted.
    In the sharepoint list you would look for the key column / field and update or delete that specific row." part.

    I apologize for the inconvenience, but I would appreciate it if you could explain it to me in more detail (with images of the flow if possible).

     

    The flow I was able to build is as follows.

     

    20231220-01.png

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    20231220-02.png

     

     

     

     

     

     

     

     

     

     

     

     

    Parsing JSON:

    {
        "type""array",
        "items": {
            "type""object",
            "properties": {
                "@@odata.etag": {
                    "type": [
                        "string",
                        "null"
                    ]
                }
            }
        }
    }
  • DexPoint Profile Picture
    191 on at

    Hi Patricia11,

    Sorry i was away for holidays. but i was looking for better methods to compare lists / arrays.  Here is a YouTube video to compare lists without doing the loops like i use. so in the future this will be a much more efficient way.

    https://www.youtube.com/watch?v=4IphRdADJBc

    The credit goes to DemoBird who i know also posts on the forums here.

    also if you want the list to add or remove you can use a filter with contains and one without. take a look. As im just returning i havent had chance to build anything yet.

     

    Dex

  • Patricia11 Profile Picture
    on at

    Hi @DexPoint ,

     

    Thank you for your reply.

    I appreciate your help.


    I built a flow while watching the video you taught me, but I keep getting an error.
    Could you please let me know if there is a solution?
    (Blanks may occur in the Excel sheet due to operational reasons.)

     

    The error message is below.

     

    The 'inputs.parameters' of workflow operation 'Creating an item' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'item/OData__x8acb__x6c42__x66f8__x66f8__x97' is required to be of type 'String/date'. The runtime value '""' to be converted doesn't have the expected format 'String/date'.

     

    20240118-03.png

     

     

     

     

     

     

     

     

    The flow I built is below.

     

    20240118-01.png20240118-02.png

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
Haque Profile Picture

Haque 604

#2
Valantis Profile Picture

Valantis 502

#3
Vish WR Profile Picture

Vish WR 417

Last 30 days Overall leaderboard