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 / How to compare two col...
Power Automate
Unanswered

How to compare two columns in two different Sharepoint lists

(0) ShareShare
ReportReport
Posted on by 119
I am trying to compare the value of two columns where their origin is two different Sharepoint lists, in the first column called 'Solicitante' belongs to list A where the column type is a line of text, the second column called 'Usuario' belongs to list B equally the column type is a line of text.
 
I need to validate and compare is that if the two columns are the same, it starts an approval and in case they are not the same, it will send an email.
 
As help I have consulted the following topic where he comments that he also wants to compare two columns, I have tried to replicate it in my flow but I am presenting the problem that emails begin to be sent for each record that I have my list A taking into account that the value of the column 'Solicitante' and the value of the column 'Usuario' are the same, case that should not happen since if they are the same no mail is sent.

I have built the flow as follows:

  • First I get the items from list A and then I get the items from list B respectively called 'get items' and 'Get items 2'
    sebastianslz_2-1662670386984.png
     
    • Then I have a validation (really nothing important for the question) but I use it to validate if the reason is New or replacement, it is really not important to comment on it in this case since this validation works correctly.
    sebastianslz_4-1662670559392.png
    • Here comes the important thing, when the reason is New in the previous validation will enter to perform the validation that I am looking for to compare the two columns, following the indications of the topic that I commented above I make the comparison of the two columns adding an Apply to each for each value obtained from the elements.
     
    sebastianslz_5-1662670640349.png
    • As you can see in the 'Apply to each 6' I refer to the value I get from the step 'Get items 2' and in the 'Apply to each 7' I refer to the value I get from the step 'get items', later in the condition (Valid user leader) 3 I perform the validation of comparing the two columns 'Solicitante' and 'Usuario' these columns are obtained from the steps of 'get items' and 'Get items 2' respectively.
     
    So far my complete flow, in summary as I already mentioned the problem I am presenting is that for each record I have in list A an email is sent, a case that should not happen because if the columns of list A and list B are the same, the emails will not be sent.
     
    Another point to keep in mind, is the validation if it is being fulfilled successfully since it also initiates the approval along with that also sends the emails, is there something that is wrong in my flow ?
     

     

Categories:
I have the same question (0)
  • lbendlin Profile Picture
    8,474 Super User 2025 Season 2 on at

    When you fetch your lists Power Automate then thinks that you want to do something with each of the list items. (The "For each" loop).  That doesn't seem to be the case in your scenario so you need to correct the code accordingly to remove the looping.

     

    That also means the way you do the list validation is actually important and must be part of the discussion.

  • sebastianslz Profile Picture
    119 on at
    You mention that I should delete one of the loops, which loop should I delete?
  • lbendlin Profile Picture
    8,474 Super User 2025 Season 2 on at

    Both of them.  You already compared the lists in some mysterious way, so no need to iterate through the cartesian product again. It's not clear what needs to be done next - you may need some loops for the update steps.

  • sebastianslz Profile Picture
    119 on at
    @lbendlin  I need to at least leave the loop with which I am getting the element of the 'Usuario' column since when using the 'Get Items' step it adds it to me in automatic, the User column I can only get from 'Get Items 2'

    sebastianslz_0-1662764358423.png
    The Apply to each is added automatically when I add 'Usuario' from Get Items 2, is there another way to do it ?

     

    sebastianslz_1-1662764566712.png

     

     

    Try it this way and for each item you have in list B the mail will be sent even if the condition is true
  • lbendlin Profile Picture
    8,474 Super User 2025 Season 2 on at

    this goes back to my original question - how are you comparing the lists?  Are you putting the result in an independent variable?  That would help you avoid the automatic looping.

  • sebastianslz Profile Picture
    119 on at
    @lbendlin  I am comparing the lists in the following condition:
     
    sebastianslz_0-1662826620966.png

     

    Where I only make use of the columns I want to compare that are 'Usuario' and 'Solicitante', I am not adding the result in a independent variable, how can I do that?
  • lbendlin Profile Picture
    8,474 Super User 2025 Season 2 on at

    when you compare lists you check if both lists have the same elements. I think you are not comparing lists, you are comparing values. For these you need to use the iterator loops.

  • sebastianslz Profile Picture
    119 on at

    @lbendlin 

    Could you give me an example using iterator loops taking into account what I have built so far of my flow?, I have not yet worked with iterator loops
  • lbendlin Profile Picture
    8,474 Super User 2025 Season 2 on at

    Can you provide some sample data and indicate the expected outcome?

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard