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 / OnChange event on Comb...
Power Apps
Unanswered

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
    );
);
 
I have the same question (0)
  • Suggested answer
    jpespena Profile Picture
    335 on at
    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!

     
  • GFinlayTerumo Profile Picture
    118 on at
    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
    GFinlayTerumo Profile Picture
    118 on at
    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
  • jpespena Profile Picture
    335 on at
    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!

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard