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 / Multi select combo box...
Power Apps
Answered

Multi select combo box clear other values if "none of the above" selected

(0) ShareShare
ReportReport
Posted on by 14

Hello! I have a multi-select combo box and want to clear all other values if "None of the above" is selected. I have come close with:

 

ComboBox.OnChange

If("None of the above" in ComboBox.Selected.Value, UpdateContext({varNoneAbove:true}); UpdateContext({varNoneAbove:false}))

 

Can I update the values in a multi select combo box within the .OnChange of that same multi select combo box?

 

Any ideas? Thanks in advance!

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,415 Most Valuable Professional on at

    Hi @RoarkeP ,

    You are only setting a Variable here (not clearing anything), but the code would be on the OnChange

    UpdateContext(
     { 
     varNoneAbove:
     Self.Selected.Value = "None of the above" 
     }
    )

     What are you then trying to update?

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • RoarkeP Profile Picture
    14 on at

    Thank you for responding!

    Multi-select combo box

    • Choices are pulled from a SharePoint list ("A", "B", "C", "D", "None of the above")
    • When users selects "None of the above" I want to remove any other values also selected ("A" - "D")

    When I put your code in the OnChange property of the DataCardValue, the "=" causes an error:

    2021-04-20_16-22-30.png


    Do you need to know more to suggest other ideas?

  • WarrenBelz Profile Picture
    153,415 Most Valuable Professional on at

    @RoarkeP ,

    Firstly, you must have the Variable varNoneAbove already defined as another data type - I tested the syntax here and it worked fine. If you simply want to reset the control, do this OnChange

    If(
     "None of the above" in Self.SelectedItems.Value,
     Reset(Self)
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • RoarkeP Profile Picture
    14 on at

    How do I have the Variable varNoneAbove already defined as another data type? When I put the syntax above in the OnChange of the control, it errs as follows:

    2021-04-20_21-48-53.png

  • WarrenBelz Profile Picture
    153,415 Most Valuable Professional on at

    @RoarkeP ,'

    You did not say you were using DataVerse - I assumed SharePoint.

    I am not a DV user, but you might look at what the valid output of ComboBoxName.Selected.Value is.

    Also this blog may be of assistance.

  • RoarkeP Profile Picture
    14 on at

    Ah yes - DataVerse indeed - The blog is useful theoretically but was not enough to resolve my issue. Thanks for all the input!!

  • v-xiaochen-msft Profile Picture
    on at

    Hi @RoarkeP ,

     

    I did a test for you.

     

    1\ This is my column 'Test10' in table 'Test 66S' . It's a Choices column. 

     

    v-xiaochen-msft_0-1619424626029.png

    v-xiaochen-msft_1-1619424642038.png

     

    2\ Add a combo box control 'ComboBox1' and set its Items property to:

    Choices('Test 66S'.Test10)

     

    Set its Onchange property to:

    If("None of the above" in Concat(ComboBox1.SelectedItems.Value,Text(Value),","),Reset(ComboBox1))

     

    3\ The result is as follows:
    AAA.gif

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

     

     

  • RoarkeP Profile Picture
    14 on at

    Hello - thanks for the input - I believe both solutions are working for both of you. However, there may be something wrong with my setup/environments because they still are not working for me.

  • v-xiaochen-msft Profile Picture
    on at

    Hi @RoarkeP ,

     

    Could you provide details?

     

    Best Regards,
    Wearsky

  • Community Power Platform Member Profile Picture
    on at

    @v-xiaochen-msft   I was able to get my combo box working per your example expression.  One issue I ran into was when I choose "None of the above" it clears that selection also... I'd like for users to be able to at least make that selection.  Any ideas on making that happen? 

    Here is what I have: 
    If( "None of the above" in Concat( cmbBusinessBenefit.SelectedItems.Title, Text(Title),", "), Reset(cmbBusinessBenefit))

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

#2
Kalathiya Profile Picture

Kalathiya 340

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 333 Super User 2025 Season 2

Last 30 days Overall leaderboard