cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

Comparing values from two different sources in a condition?

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. 

 

1 ACCEPTED SOLUTION

Accepted Solutions

@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

 

View solution in original post

10 REPLIES 10
Super User II
Super User II

@KBeale 

 

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

 

Thanks

Hardesh

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

@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 

 

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

Thanks

Hardesh

@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

@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

 

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 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 

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

 

View solution in original post

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

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (3,463)