web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / If CountRows(Combox1.S...
Power Apps
Answered

If CountRows(Combox1.SelectedItems)>1 then a specific value is display in another dropdown

(0) ShareShare
ReportReport
Posted on by 152

Hi,

I have combo box and drop down in my app. Combo box and Dropdown is Cascaded which means where based on values selected in combo box, dropdown list is displayed.

Example:-

Combo box has below values:

Team A

Team B

Unknown.

 

Drop Down has below values

 

Person 1

Person 2

NA

 

When I selected Team A in combo box, drop down displays Person 1

 

Combo Box has multi selection property as True. My query is- if I select more than 1 values from combo box, Drop down should display NA.  

Categories:
  • SD29 Profile Picture
    152 on at

    It will be really helpful if anyone can help me with this issue. I am really stuck with this since days.

  • Gochix Profile Picture
    1,937 Moderator on at

    @SD29 ,

     

    Try:

    If(CountRows(ComboBox1.SelectedItems)>1,["N/A"],["A","B"])


    _____________________________________________________________________________________
    Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!

  • SD29 Profile Picture
    152 on at

    Thanks for the response @Gochix , ["A","B"] will be hardcoded but my sharepoint list columns can have multiple values added in future. Hence, can you share solution based on dynamic approach. So that in future I am not required to change code.

  • Gochix Profile Picture
    1,937 Moderator on at

    @SD29 ,

     

    The ["A", "B"] was placed there just as an example for you. If you explain what's the logic then we can have a look into it. The original request was how to achieve displaying "N/A" if multiple values selected in the ComboBox.
    _____________________________________________________________________________________
    Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!

  • SD29 Profile Picture
    152 on at

    @Gochix , Currently 

    Combo box has below values:

    Team A

    Team B

    ''

    ''

    Unknown.

     

    Drop Down has below values

     

    Person 1

    Person 2

    ''

    ''

    NA

    '' this sign signifies more values listed in the column.

     

    Currently When I select Team A in combo box, drop down displays Person 1 - Cascading relationship is created.

     

    I want to build a dynamic logic like  if I select more than 1 values from combo box example-Team A & Team B then Drop down should only display NA. 

     

    So if I use your below solution, what should I replace ["A","B"] with ? 

    Should I be applying this in Default property of Dropdown ?

    If(CountRows(ComboBox1.SelectedItems)>1,["N/A"],["A","B"])

     

  • Gochix Profile Picture
    1,937 Moderator on at

    @SD29 ,

     

    Could you share what you have currently in the Items property of the DropDown? 

    Gochix_0-1714239600958.png

     

    Knowing this I can help more.


    _____________________________________________________________________________________
    Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!

  • SD29 Profile Picture
    152 on at

    For DropDown Items Property below is the query-

    Filter('Team Lookup',Team=ComboBox1.Selected.Value)

     

    where Team Lookup is the SharePoint List ComboBox1 is the name for Combo Box in app. Person Detail Column values are displayed in App Dropdown

    SD29_1-1714240629578.png

     

     

  • Gochix Profile Picture
    1,937 Moderator on at

    @SD29 ,

     

    Thanks, so your code should be:

     

    If(CountRows(ComboBox1.SelectedItems)>1,["N/A"],Table({Value:LookUp('Team Lookup',Team=ComboBox1.Selected.Value).'Person Detail'}))

     


    _____________________________________________________________________________________
    Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!

  • SD29 Profile Picture
    152 on at

    Thanks for the code. Do I need to write this code in Default property of DropDown Card  or Default property of DataCardValue1 ?

  • Gochix Profile Picture
    1,937 Moderator on at

    @SD29 ,

     

    You can write it in the Items property of the DropDown.
    _____________________________________________________________________________________
    Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard