Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Comparing Three Combo Box Selections ('Or' Scenario)

(0) ShareShare
ReportReport
Posted on by 402

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:
  • pp365 Profile Picture
    402 on at
    Re: Comparing Three Combo Box Selections ('Or' Scenario)

    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)

  • Verified answer
    LaurensM Profile Picture
    12,510 Super User 2025 Season 1 on at
    Re: Comparing Three Combo Box Selections ('Or' Scenario)

    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!

     

  • BCBuizer Profile Picture
    22,027 Super User 2025 Season 1 on at
    Re: Comparing Three Combo Box Selections ('Or' Scenario)

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

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard