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 get the interse...
Power Automate
Unanswered

How to get the intersection of two datatable in power automate desktop ?

(0) ShareShare
ReportReport
Posted on by

I have two datatables extracted from excel.

 

Now, I need to get the data that is the same between two tables. which means intersection.

 

 But I can't find an available function in PAD.

 

Any advice?

 

 Thanks

I have the same question (0)
  • lbendlin Profile Picture
    8,726 Super User 2026 Season 1 on at

    You can only do that with lists, not with tables.

     

    lbendlin_0-1689807220346.png

    You would have to concatenate all columns in a row to a string and then treat the result as a list of strings.

     

    There is this 

    lbendlin_1-1689807404102.png

     

    but it works on columns, not rows. Comparing column by column defeats the purpose.

     

    There is no pivoting action as far as I am aware.

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    There is no native function to do that in PAD. But, assuming you are matching the tables based on some Id column or something like that, you could use Retrieve data table column into list to get that column from both of your tables, then use Find common list items to compare the two lists, and then build some loops, where you use the Find or replace in data table action to find the row indexes for each matched item in both tables. 

     

    This might be a bit slow for large tables, but it should generally do the trick and allow you to proceed with whatever you want to do next with the matched items.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @Kryu 

     

    Another way would be use to connect excel as database and use sql queries to perform 

     

    But this would only possible if you add the second excel sheet data into the first excel as another sheet 

    So first excel file would have 2 sheets : Sheet1 and Sheet2

     

    Now connect to excel using sql connection and use inner join to join two tables based on a column or combination of 2 or more column conditions. Take this as an example

     

    I have an excel file having two sheets

    Nived_Nambiar_0-1689856761257.png

     

    Nived_Nambiar_1-1689856769898.png

     

     

    See below flow on how to do inner join 

    Nived_Nambiar_2-1689856792570.png

     

    SQL query used :  SELECT table1.A,table1.B,table1.C FROM [Sheet1$] as table1 INNER JOIN [Sheet2$] as table2 on table1.A=table2.A

     

    Output of this sql query would be : 

    Nived_Nambiar_3-1689856843580.png

     

     

    [But you want to make the power automate flow in such a way that before performing this sql operation, add the second excel file data to first excel file as another sheet and once sql query is performed, delete that newly added sheet if needed ]

     

    I know it would be little complex at design part, But you can give a try and see if it gives you expected results or not 🙂

     

    Hope it helps 

     

    @Agnius  @lbendlin  let me know your thoughts on this as well 🙂

     

  • lbendlin Profile Picture
    8,726 Super User 2026 Season 1 on at

    The join condition in step 3 would have to include all columns.  Other than that - nice workaround.

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Yes, @lbendlin 

     

    @Kryu  can edit the columns required based on requirement 🙂

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Yes, this is also an option. It does require extra drivers to be installed on the machine. See here for reference: https://learn.microsoft.com/en-us/power-automate/desktop-flows/how-to/sql-queries-excel

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 223

#2
David_MA Profile Picture

David_MA 210 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 175

Last 30 days Overall leaderboard