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 / If CountRows(Combox1.S...
Power Apps
Unanswered

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:
I have the same question (0)
  • 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,935 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,935 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,935 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,935 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,935 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

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 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard