Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Comparing values from two different sources in a condition?

(0) ShareShare
ReportReport
Posted on by 312

I'm working on an approval flow where the requestor's manager and department head need to approve a request. In some cases they will be the same person, in which case I don't want to ask them to approve twice.

 

In my initial flow I added a condition right after the first approval using two answers from the form which is my trigger (as shown below) and it worked perfectly. 

Screen Shot 2020-09-01 at 14.18.55.png

I realized that it's preferable to pull their manager from AD rather that ask them to type it in, but when I did so and updated the condition, I started getting the double approval requests again if the supervisor and department head were the same person. 

Screen Shot 2020-09-01 at 14.15.37.png

I'm wondering whether it's not possible to compare values from two sources? Or if I'm (hopefully) using the wrong tokens? Any help or ideas to resolve the situation would be very very appreciated! 

 

Note: To make things more complicated, "Department head" is a designation which isn't included in our AD, so I have to pull that info from a list using their Department. 

 

  • KBeale Profile Picture
    312 on at
    Re: Comparing values from two different sources in a condition?

    @Hardesh15 thank you so much! You're the best! 🙂 

  • Verified answer
    Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at
    Re: Comparing values from two different sources in a condition?

    @KBeale 

    i designed logic for comparing data from two sources. 1 Email from MS form  2. Email from SharePoint List.

    Hardesh15_0-1599039383394.png

    Hardesh15_1-1599039449370.png

    i am storing all SharePoint Column name emails in Select Action then making similar output from MS Form email so that i can compare it. Now in this way you can compare Two sources.

     

    Thanks

    Hardesh

     

  • KBeale Profile Picture
    312 on at
    Re: Comparing values from two different sources in a condition?

    @Hardesh15 I figured out my problem! I was using an admin account as the requestor to avoid emailing my actual supervisor, and I realized that although it is in AD with me as the supervisor, it didn't have a Department assigned. Since my query to pull the Department head was based on the Department, the "Department Head" value I was trying to compare with the Manager value was empty (facepalm!) I appreciate your help and I'm sorry to take up your time. If you could easily point me towards info on using select action and mapping my key and value I would be interested to learn more, but no worries if not. Thanks again! 

  • KBeale Profile Picture
    312 on at
    Re: Comparing values from two different sources in a condition?

    Thank you!! If you could get me started or point me point me towards more info on using select action and mapping my key and value I would greatly appreciate it! Sweet dreams! 

  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at
    Re: Comparing values from two different sources in a condition?

    @KBeale 

    I will see your flow tomorrow as it is going to be mid night. Yes you can compare two sources and it depends on your requirements. Suppose you want person department from SharePoint list and also you are taking person department from ms form inputs then you can use get items as you shown in last image and then you can use condition action to compare department for further action. Its better use select action after get items and map your key and value. Select action stores all data in array from get items. Basically it is faster than apply to each action.

    Thanks

    Hardesh

     

  • KBeale Profile Picture
    312 on at
    Re: Comparing values from two different sources in a condition?

    @Hardesh15 Thank you! But actually the flow was actually working just as I wanted until I swapped the mail token from "Token manager" for one from the Form response (the supervisor's email). I only showed one branch in the screenshot because that the first condition seemed to be the problem (and it would be tiny!), but there's also another one that deals with the if the "If no" path (if that makes sense!) The whole thing is below, I hope it's not too small to see. 

     

    And I included the last screenshot because what I actually want to compare in the first condition is the responder's manage, and their Department Head, which I need to pull from a list. I tried to do in that step, but I haven't added it to this flow yet because I was trying to isolate why the condition wasn't working. 

     

    Sorry if my initial post was confusing. Re: my big question, If I want to compare values from two different sources, are there particular tokens I need to use? Thanks again! 

    Screen Shot 2020-09-01 at 19.20.53.png

  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at
    Re: Comparing values from two different sources in a condition?

    @KBeale 

     

    You are using 'Response is equal to approve' instead of this use 'Outcome is equal to Approve'.

    Thanks

    Hardesh

  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at
    Re: Comparing values from two different sources in a condition?

    @KBeale 

     

    i think you should use 'is not equal to' in condition block 3 because when manager and Head is same person and you want to skip approval process again. i hope i understand your problem correctly. Why do you think last added screen will help you here?

     

    Thanks

    Hardesh

     

  • KBeale Profile Picture
    312 on at
    Re: Comparing values from two different sources in a condition?

    Thank you for getting back to me @Hardesh15! Screenshots of the flow as it looks now are below, with the problematic condition circled.

     

    I would ultimately like to add a step that uses the identity of the person responding to the form to pull their Department Head from a list, and then compare that their Manager in the condition, but I'm not sure if that step is correct, or where to add it. I've included a screenshot of what I have now at the bottom of this message. Thanks again! 

    1.png

     

    2.png

     

    3.png

    Step pulling Department Head from a list (not yet added to the Flow above): 

     

    Screen Shot 2020-09-01 at 18.24.34.png

  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at
    Re: Comparing values from two different sources in a condition?

    @KBeale 

     

    Please share your flow screens. it is possible to compare fields from two sources.

     

    Thanks

    Hardesh

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1