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 Apps / Comparing Three Combo ...
Power Apps
Unanswered

Comparing Three Combo Box Selections ('Or' Scenario)

(0) ShareShare
ReportReport
Posted on by 439

Hi all,

 

I'm expecting this is a really easy solve, but I've wasted quite a lot of time on it now and can't spot the answer.

 

I have three Comboboxes. I want to compare the selection in the first combobox to the second and the third. If the selection in the FIRST matches the selection in the SECOND OR the THIRD, return true.

 

I'm finding that the expression is evaluating correctly for the comparison between the first and second combobox but it pays no attention to whatever value is in the third. IE if the same selection is made in combobox 1 and combobox 3, the result is false whereas it should be true.

 

I am using the expression below:

 

(The comboboxes are named: 'cmb-3-FirstChoice', etc. The selectable option list for each combobox is supplied from 'AppDataType1').

 

If(
 'cmb-3-FirstChoice'.Selected.AppDataType1 = 'cmb-3-SecondChoice'.Selected.AppDataType1 Or 'cmb-3-ThirdChoice'.Selected.AppDataType1,
 
UpdateContext({cmbstate: true})

 

I have tried changing 'Selected.AppDataType1' to .SelectedItems but meet with the error that tables cannot be compared.

 

Any help much appreciated! Thank you!

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @pp365 ,

     

    Here you go: 

     

    If(
     'cmb-3-FirstChoice'.Selected.AppDataType1 = 'cmb-3-SecondChoice'.Selected.AppDataType1 Or
    	'cmb-3-FirstChoice'.Selected.AppDataType1 = 'cmb-3-ThirdChoice'.Selected.AppDataType1,
    	UpdateContext({cmbstate: true})
    )

     

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @pp365,

     

    You can use the condition as the input of your variable - the condition will return true or false:

     

    UpdateContext(
     {
     cmbstate: 'cmb-3-FirstChoice'.Selected.AppDataType1 = 'cmb-3-SecondChoice'.Selected.AppDataType1 || 'cmb-3-FirstChoice'.Selected.AppDataType1 = 'cmb-3-ThirdChoice'.Selected.AppDataType1
     }
    )

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

     

  • pp365 Profile Picture
    439 on at

    Many thanks @LaurensM and @BCBuizer for the really helpful and fast responses! 

     

    To make it easy for anyone reading this thread in the future, essentially the issue was that in the 'Or' part of the If statement, the test condition had to be entered again (after the 'Or'), like this:

     

    If(ItemtoTest = 1 Or ItemToTest = 2, outcome if true)

     

    (Please note that both of the replies received to this thread are accurate and valid. I marked @LaurensM  as the Solution as first to reply but @BCBuizer 's solution is also great and easy to understand)

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard