Skip to main content
Community site session details

Community site session details

Session Id : xOe5/sGVlh70PqKBgZzkMD
Power Apps - Building Power Apps
Suggested answer

Combo box auto-unselects after selection

Like (1) ShareShare
ReportReport
Posted on 24 Mar 2025 18:43:30 by 59
Hello,
 
I'm stuck on a app for months.
 
When a "Catégorie" is selected, my "Sujet" combo box auto-unselects after selection.
 
I've tried thousands of different things.
 
Here's my app attached.
 
You can test 2 ways :
- With the "Button" button :  Start by selecting a "Catégorie", then hit the button. You'll see "TestSujet" briefly appearing on the 2 test labels, then getting cleared automatically.
 
- With the "SujetCombo" dropdown : Start by selecting a "Catégorie", then select a "Sujet". You'll see the dropdown selection automatically reverting back to blank.
 
 
Thanks for your help!
 
 
 
 
 
 
Categories:
  • Suggested answer
    trogne Profile Picture
    59 on 02 Apr 2025 at 14:01:03
    Combo box auto-unselects after selection
    I finally got it working.
     
    When I change "sujet", the corresponding "catégorie" updates.
     
    But I already had code to update the "sujet" dropdown values when "catégorie" changes.
     
    So, when the corresponding "catégorie" updates, it was then updating the "sujet" dropdown values and selecting a blank value.
     
    I added a check so that the sujet dropdown does not change if it had a value initially.
     
    This is the "Catégorie" combobox "OnChange" code : 
     
    If(
        !gblIsUpdating,
        Set(gblIsUpdating, true);
        If(
            !IsBlank(LookUp(gblSelections, ID = ThisItem.ID, Sujet)) &&
            LookUp(Sujets, Sujet = LookUp(gblSelections, ID = ThisItem.ID, Sujet), Catégorie) <> Self.Selected.Value,
            Patch(
                gblSelections,
                LookUp(gblSelections, ID = ThisItem.ID),
                {Categorie: Self.Selected.Value, Sujet: ""}
            ),
            Patch(
                gblSelections,
                LookUp(gblSelections, ID = ThisItem.ID),
                {Categorie: Self.Selected.Value}
            )
        );
        Set(gblIsUpdating, false)
    )
     
     
    And the "Sujet" combobox "OnChange" code :  
     
    If(
        !gblIsUpdating && !IsBlank(Self.Selected.Sujet),
        Set(gblIsUpdating, true);
        Set(gblTempSujet, Self.Selected.Sujet);
        Patch(
            gblSelections,
            LookUp(gblSelections, ID = ThisItem.ID),
            {
                Sujet: gblTempSujet,
                Categorie: LookUp(Sujets, Sujet = gblTempSujet, Catégorie)
            }
        );
        Set(gblIsUpdating, false);
        Set(gblTempSujet, "")
    )
     
     
     
  • ronaldwalcott Profile Picture
    3,825 Super User 2025 Season 2 on 01 Apr 2025 at 21:27:57
    Combo box auto-unselects after selection
    Can you state what the problem is and what you are trying to do without your app having to be installed.
  • trogne Profile Picture
    59 on 01 Apr 2025 at 19:14:33
    Combo box auto-unselects after selection
     
     
    I don't understand those phrases : 
     
    • When Catégorie is being changed  first in the control there will be OnChange Property check for that is there any variable is being set to the control . (for e.g Set(variablename,Catégorie.Selected.Value)  and check in the target combo-box (Sujet) control Defaults / Default Selected Item Property is it referring to any such values.
    • Is the second combo box - Is cascading ? If yes also look for the Items property of the combo box have you written any filter condition accordingly.
     
    What should I check first ?
     
  • MS.Ragavendar Profile Picture
    3,056 Super User 2025 Season 2 on 26 Mar 2025 at 06:10:03
    Combo box auto-unselects after selection
     
    Does the below analysis helped or still facing the challenge?
  • Suggested answer
    MS.Ragavendar Profile Picture
    3,056 Super User 2025 Season 2 on 25 Mar 2025 at 06:20:38
    Combo box auto-unselects after selection
     
    Hi watch out the property of Default or Default Select Items in the combo-box. 
     
    If its form control you cannot reset the controls in the form like Reset(control/ datacard) which wont work you can only ResetForm() since you saying only with respect to the control.
    • When Catégorie is being changed  first in the control there will be OnChange Property check for that is there any variable is being set to the control . (for e.g Set(variablename,Catégorie.Selected.Value)  and check in the target combo-box (Sujet) control Defaults / Default Selected Item Property is it referring to any such values.
    • Is the second combo box - Is cascading ? If yes also look for the Items property of the combo box have you written any filter condition accordingly.
     
    These are two things that you check and revert us back.
     
    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
     
     
  • Michael E. Gernaey Profile Picture
    46,507 Super User 2025 Season 2 on 25 Mar 2025 at 00:28:08
    Combo box auto-unselects after selection
     
    I am going to quote and stop. You said. You've tried 1000s of things for what? What is the issue?
    What is Category (no i don't install other people's apps from zips so you'll need to explain here)
     
    Are these on a Form, a Gallery, just a Screen? When a Categories is selected, you are saying another Combobox clears its selected items? If so then somehow they are linked by data changing. So need to understand in more details that are missing.
     
    Hello,
     
    I'm stuck on a app for months.
     
    When a "Catégorie" is selected, my "Sujet" combo box auto-unselects after selection.
     
    I've tried thousands of different things.

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473