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 / Unsaved changes Popup
Power Apps
Unanswered

Unsaved changes Popup

(0) ShareShare
ReportReport
Posted on by

I have a label that is visible (unsaved changes warning) when changes are made to text box. Popup works fine, but if I delete the changes I have made in a text box, the warning popup stays visible. Is it possible to detect if contents of a textbox was set back in the original state?

 

Label.visible = NeedsSaved3

TextBox.OnChange = Set(NeedsSaved3, true)

Button that saves changes, OnSelect= Set(NeedsSaved3, false)

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Anonymous 

    What is the Default property of the Textbox?

    Typically this is done with a comparison rather than a variable.

    i.e.  the Visible property of your Label - theDefaultPropertyValue <> theTextBox.Text

    This will set the label visible if the value is changed.

    I hope this is helpful for you.

  • Rivius Profile Picture
    269 on at

    In the OnChange for the text box, If Self.Text is Blank, Set(NeedsSaved3, false).

  • Community Power Platform Member Profile Picture
    on at

    Default of TextBox is ThisItem.Description . Description is column from datasource.

     

    ThisItem.Description cant be added to Visible of label.

  • Verified answer
    Rivius Profile Picture
    269 on at

    Add on another IF in the OnChange, if Self.Text = ThisItem.Description, Set(NeedsSaved3,false)

  • Community Power Platform Member Profile Picture
    on at

    This works.

    But if I put this on multiple text boxes, and I change 2 of them, and then change only 1 to the original text, warning goes away, even if the second textbox is still left changed.

     

    My code for OnChange on textbox is now like this:

     

    Set(NeedsSaved3, true);
    If( Self.Text = ThisItem.Description, Set(NeedsSaved3,false))
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Anonymous 

    You need to compare on the original value to the textbox value.  Variables will be a bit clunky to deal with as you are seeing.

    Out of curiosity, is this in an EditForm?  If so, then the form already provides a mechanism for this.

     

  • Rivius Profile Picture
    269 on at

    In that case you'll have to check all of them.

    If ( Self.Text = ThisItem.Description || OtherTextBox.Text =  xxx || etc. etc., Set(NeedsSaved3, false))  

    Depending on how many you are dealing with there could be a more elegant solution.

  • Rivius Profile Picture
    269 on at

    @RandyHayes you referring to the Form.Unsaved flag?  Will it show unsaved if the text has been changed but ultimately changed back to what it was originally or not show the unsaved flag if it matches?

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Rivius 

    Yes, the unsaved will be true if there are changes.  If a user returns a value to its original value, the unsaved will be false.

  • Rivius Profile Picture
    269 on at

    Good to know, I worked with the unsaved flag a couple years ago but it wasn't functioning correctly.  I'll have to add that back to my tool belt.

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