web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Creating an unsaved ch...
Power Apps
Answered

Creating an unsaved changes warning on edit form - Combo Box firing in error

(0) ShareShare
ReportReport
Posted on by 9

I have an App with a SharePoint List Data Source. There are various multi-select combo boxes on Forms with default mode Edit. Making changes to the SelectedItems and SubmitForm is working fine.

 

I want a warning whereby if someone makes a change to any fields on the form but hasn't yet submitted it, a text box becomes visible which says "Warning - you have unsaved changes". Putting a collection in the OnChange of each field, then passing that to the visibility of the warning textbox is working fine for all control types apart from the ComboBoxes. These keep firing when the app is opened, even when there have been no changes to the SelectedItems.

 

I have seen others encountering the same problem in various threads, but can't find a workaround that actually works. Best solution I found was to check the ComboBox SelectedItems against the data source, and fire the OnChange collection only if they don't match. But I can't get the syntax correct and keep getting errors saying this formula uses scope.

 

I'm sure it's something simple but I've spent hours and can't get it.

The Concat(ComboContributor.SelectedItems.DisplayName, ",") on the right of the OnChange is working as expected. But trying to get a match from the data source on the left that isn't working.

Help most welcome! Thanks.

OnChange Formula.png
Categories:
I have the same question (0)
  • SolTeferi Profile Picture
    on at

    Hi @LulaLong ,

    If I understood you correct, I think it is easier to put the check on the submit button. When the submit button is clicked, create a variable for the combobox selected item like the one below:

     

     

    Set(varComboBoxItems,ComboContributor.SelectedItems)

     

     

    and then if any change is made after that on the combobox, put something on the visibility of the Unsaved Changes text label as shown below:

     

     

     

    Concat( ComboContributor.SelectedItems,",")<>Concat(varComboBoxItems,",")

     

     

     With that being said, I recommend to simply change the edit mode of the form to view mode on click of the submit button and show the item just submitted unless you have a reason to keep it in edit mode after it is submitted.

  • lyndseylula Profile Picture
    48 on at

    Discard comment, wrong account used 

  • LulaLong Profile Picture
    9 on at

    Thanks. Yes, it needs to be edit mode as the users will be updating the data with the app.

     

    The problem is that when you first open the app, it says “you have unsaved changes” even though you’ve not done anything yet. I believe it is to do with the way the app gets the data for combo boxes.

     

    The warning needs to come before submit.

    For other fields using OnChange as a trigger to add to a collection which makes the warning appear works fine. Just not for Combos.

  • Verified answer
    SolTeferi Profile Picture
    on at

    Got it! Can you try this. On the  Onvisible property of the screen, define a variable like the one below:

    Set(varStart,False)

    Then on the Visible property of the "Unsaved Changes" label, put the following:

    If(varStart, Concat( ComboContributor.SelectedItems,",")<>Concat(varComboBoxItems,","))

    Then, on the click of the submit button, put the following:

    Set(varComboBoxItems,ComboContributor.SelectedItems); Set(varStart,True)
  • lyndseylula Profile Picture
    48 on at

    .

  • lyndseylula Profile Picture
    48 on at

    .

  • LulaLong Profile Picture
    9 on at

    It worked, thank you!!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard