Not sure if this is a bug or expected behavior, i have a form with a bunch of text boxes, lookups, dates etc all going back to an SQL database.
If i setup the form with dates, dropdowns (with the correct allowed values and defaults) the Form.Unsaved works correctly, make a change to a drop-down, updates = true, change back , updates = false. THe issue comes in with Text boxes. The fields in the database default to ('') and then are are varchar(5000). PowerApps will always report that the form has changes when it loads even if the field is blank. I found that if you add TrimEnds() to the default value of the data card (for example TrimEnds(ThisItem.Issue1) where issue1 is a field) then it works correctly. Anyone else come across something like this or am i missing something in the database setup?
So, it's been 21 Months since this bug was first reported, and it is still a problem in every single PowerApp that I write.
Seeing as PowerApps CORE functionality is the in the use of forms, I would expect a lot better from Microsoft.
Can we please have an update on when this BUG will be fixed?
I have been looking at this for a long time and I actually think this is not 1 bug but multiple ‘features’ of Power BI.
Every time I have encountered this issue (it has been 100s) I have found a route cause as to why Powerapps thinks the form has been edited and it usually relates to existing data at source. I have found the offending attribute by creating a copy of the edit form and adding each attribute to the new form 1 at a time. I also have a label/button that is visible when frm.unsaved.
Below is a summary of the causes and fixes I have seen whenever I open a record and immediately frmUNSAVED = True
Back end is SQL Database in all my example use cases
If i find or think of any more i will update this post.
My Form datasource is SharePoint with the same issue Form.Unsaved = true, even in View mode.
Your hints worked all the magic.
I have stumbled on a quick and dirty fix for this problem (since it doesn't appear that MSFT seems to care much about fixing this on their end). It may be of help to some of you.
In the ONVISIBLE property of your EditScreen1: start it off with ResetForm(EditForm1);
This appears to reset the 'Form.Unsaved' back to false, and allows your form to contain customized defaults without impacting this result.
I was having similar problems, even just after I had issued a "SubmitForm(frmName)" command using a save button, the form still claimed it was unsaved. However I have one fix that hasn't been mentioned. The default setting for an edit forms Item property is often set to another forms/gallery/Data tables Selected property (classic master/detail, you select a something from the Master form, it shows it's details in the detail). Instead of using this, try setting the Item value to a filtered list of the SQL table, based on the ID of the selected item. For me this means the Edit forms Item value is set to:
For some reason this slight disassociation results in the Unsaved being evaluated correctly.
Check out our new profile badges recognizing authored solutions!
We are excited to announce the Power Apps Super Users!
Did you miss the call? Check out the Power Apps Community Call here.
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!