web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Compare two list rows/...
Power Automate
Unanswered

Compare two list rows/arrays to find differences

(0) ShareShare
ReportReport
Posted on by 90

I have data coming from two sources that I have in a select to map similar column names and would like to compare property values for each. Example is Col1 from excel is equal to Col1 of other target or not. 

1.png

I can do a compare by explicitly using a condition to compare each individual property but wondering if there is a better and less time consuming way. Especially if the number of properties here will be way more than just four. 

 

Any suggestions what would be the best way to accomplish this? Let me know please.

 

Thanks,
Raheel

 

@abm 

 

Categories:
I have the same question (0)
  • CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    Hey @raoraheel 

     

    Perhaps you are use  INTERSECT.

     

    The outcome of which is a list of ALL names that appear in BOTH lists but are not unique to either..

     

    OR use UNION - The outcome of which is a list of ALL names from BOTH lists.

     

    You can find some useful information at - https://www.damobird365.com/efficien-union-except-and-intersect-great-method/ 

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

    P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

  • raoraheel Profile Picture
    90 on at

    Hi @CFernandes , The intersection works and gets me values that match. What I would eventually like to see is non-matching values. So say reverse of intersection. 

  • CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    Hey @raoraheel 

     

    What about EXCEPT

     

    An Except clause will return the elements of the first Array that DO NOT APPEAR in the second Array. You can find details in the article https://www.damobird365.com/efficien-union-except-and-intersect-great-method/ 

     

    The idea would be to use a Filter Array - 

     

    CFernandes_0-1669922234892.png

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

    P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

  • raoraheel Profile Picture
    90 on at

    @CFernandes I couldn't get it to work and can't seem to figure out what i'm doing wrong. 

     

    "inputs": {
            "from""@body('SelectParamValues')",
            "where""@not(contains(body('SelectExcelValues'), item()))"
        }
     
     
    This is the result of the filter array. My expectation is that Col3 is a mis-match and should be the only result.  Any thougts?
     
    2.png
  • CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    @raoraheel - I had done this last year(2021) - I will test and let you know early next week...

  • CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    Hey @raoraheel 

     

    Let me first see if I understand correctly - 

     

    Array 1 

     

    [
    "Clavin",
    "Fernandes",
    "Mano"
    ]

     

    Array 2

     

    [
    "Clavin",
    "Fernandes",
    "Balazs"
    ]

     

    Except Ouput -

     

    "Balazs"

     

    Is this what you need?

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

    P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

     

  • raoraheel Profile Picture
    90 on at

    @CFernandes kind of, yes. Below is the exact data that i'm trying to compare. If you look here, Value for Col3 is different in both arrays. What I am trying to achieve is to identify that Col3 has a different value. Does that make sense? Appreciate your time here. Thanks!

     

    Array 1:

    [
      {
        "Col1""No",
        "Col2""ValidateMasterData",
        "Col3""2",
        "Col4""No"
      }
    ]
     
     
    Array 2:
     
    [
      {
        "Col1""No",
        "Col2""ValidateMasterData",
        "Col3"0,
        "Col4""No"
      }
    ]

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard