I'm also seeing form.Unsaved as always true.
I need to monitor state of the form in order to control the DisplayMode of the Submit button.
- If no changes have been made, DisplayMode.Disabled else .Edit
Also need to monitor state of form to control visibility of "Are you sure?" popup
- If changes have been made, show "Are you sure?" popup else navigate directly to previous screen
.Unsaved was my method. Now no longer seems to be working. Need help here.
Also issues with Form.Valid?
- I have 4 fields marked as Required (see asterisks)
- The text box is set to: "Is this form valid?: " & Form.Valid
- As you can see its set to true.
- It should be false until the required fields are filled in.
- The Default property for these fields is set to:
- If(frmForm.Mode = FormMode.New, Blank(), Parent.Default)
- Also tried just setting them to Parent.Default. No change. .Valid still evaluates to true.
Whats up here? I use .Valid for a lot of things!
This issue is there for several months now. MSFT does not react on it. I made an app which sometimes shows .Unsaved correctly and sometime not. I think this is a bug. One thing to be aware of is that this property only works on a Edit form (which you can switch in mode of course).
I was having this same problem, but mine is not querying a SQL table. Solution seems to be in the cards, and I believe there are some back end connections that are best left untouched. Flip any cards that you don't want touched to DisplayMode.VIEW and similarly, if you have fields that you want to customize the default properties for display purposes only within a card, I would instead put an additional text box or something - not change the properties of the original control. Simply flip the card's original control to Visible false. With the new control you have added, you can use the ThisItem property to propagate a custom field within a card without messing with the cards default properties. The heart of what I believe was screwing up mine was that I attempted to copy and paste prior constructions and just change the update property of the card to the new field, that seemed to disassociate the appropriate defaults and permanently render the form unsaved=true. Solution is to delete the custom cards and rebuild from scratch. For mine, I had added custom field that I DID want to have updated with form submission, so I added a patch function ahead of the submitform function to update that field. Naturally, that workaround doesn't update the Unsaved property of the form. You could do something like write an addendum to your needed Unsaved formula to check if the exogenous control's current state matches the record's "default" state for that field, but this adds an additional query to the server. For example: Lookup(DatabaseName, ID=IDDataCardValue.value).Exogenous=ExogenousControl.value
That's a really good question - since I'm not using and haven't tried any validation formulas I don't have a good answer. However, my first shot would be to place the validation formula in the submit form button. Mind you, cancel form, you will also want to reset(exogenouscontrol) in addition to resetform(form)
I experience the unexpected behavior as well. (again)
I use a lot of forms in my apps, and I have yet to figure out the reason for this unexpected behavior. I sometimes have to re-create the entire form to resolve it 😕
There are other issues with forms that I have speculated to be related to the Unsaved property. e.g the order and layout of fields when some fields (datacards) are hidden. again, pure speculations.
When issues are not answered in the forum I'd suggest creating a ticket:
I created a "pure" PowerApp from a SharePoint list as my reference. So I added a label on the EditScreen and it showed "false" for EditForm1.Unsaved - as expected.
I could also move and resize input fields without issue.
But as soon as I replaced the Default value of one input field from Parent.Default to a formula the label text would switch to "true" and just stay there - until I changed the Default value back to Parent.Default.
That is annoying!
Featuring samples like Return to the Workplace and Emergency Response Applications
We're excited to announce our first cross-community 'Can You Solve These?' challenge!
Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.
We are excited for the next Super User season.
Features releasing from October 2020 through March 2021