Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Suggested answer

OnChange event on Combobox is occurring On Load

(1) ShareShare
ReportReport
Posted on by 118
Hi
 
I have a Power App that is being populated by a SP list which I am looking to trigger an OnChange event which changes a variable to true if the user selects an item from a combobox.
 
It works fine when using the combobox to make/remove a selection but I am having a problem where the OnChange is being triggered when the user opens the Power App to Edit an existing record and it loads its values.
 
When the user opens a form to edit an existing record the ReturnCheck variable is true, it should be false by default and only set to true where the user changes the value in the Combobox.  Is there a way to make sure the ReturnCheck variable does not change when the Form loads it values?
 
App OnStart
Set(ReturnCheck,false);
 
Combbox OnChange
If(
    Not(IsEmpty(DataCardValue7.SelectedItems)),
    Set(
        ReturnCheck,
        true
    );
    ,
    Set(
        ReturnCheck,
        false
    );
);
 
  • jpespena Profile Picture
    335 on at
    OnChange event on Combobox is occurring On Load
    Hi,
     
    If my post helped resolve your issue, please click Accept as Solution—this helps others find it more easily and marks the item as closed. If you found this or my previous reply helpful, a Like would also be appreciated!
  • Suggested answer
    GFinlayTerumo Profile Picture
    118 on at
    OnChange event on Combobox is occurring On Load
    Hi again
     
    I was able to figure this out by updating your suggestion to 
     
    If(
        Self.Selected.DisplayName <> ThisItem.'Returned User'.DisplayName,
        If(
            Not(IsEmpty(DataCardValue7.SelectedItems)),
            Set(
                ReturnCheck,
                true
            );
            ,
            Set(
                ReturnCheck,
                false
            );
        ),false
    );
     
    Thanks
  • GFinlayTerumo Profile Picture
    118 on at
    OnChange event on Combobox is occurring On Load
    Hi @jpspena thanks for you reply.  I have given it a try and am having some issues. 
     
    Firstly Self.Selected.Value returns an error "Value isn't recognised".
    Secondly I am not selecting a value from a Gallery, the Power App Form is selected directly from SharePoint New/Edit, I am editing the integrated default form for the list.
     
    I have tried to update it to the following but the <> is giving me another error of 
    "Incompatible types for comparison. These types can't be compared: Record, Record."
     
    If(
      Self.Selected <> ThisItem.'Returned User',
  • Suggested answer
    jpespena Profile Picture
    335 on at
    OnChange event on Combobox is occurring On Load
    Hi,
     
    Try adding a validation on the Combobox that the value is changed, like:
     
    If(
      Self.Selected.Value <> Gallery.Selected.ComboboxField.Value,
    If(
        Not(IsEmpty(DataCardValue7.SelectedItems)),
        Set(
            ReturnCheck,
            true
        );
        ,
        Set(
            ReturnCheck,
            false
        );
    )
    );
    This way, it will only be triggered if the value of the combobox is not equal to the field from the selected item in the gallery.
     

    If my post helped resolve your issue, please click Accept as Solution—this helps others find it more easily and marks the item as closed. If you found this or my previous reply helpful, a Like would also be appreciated!

     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1