cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

Re: Issues with Form.UnSaved

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. 

 

Thanks

Highlighted
Super User
Super User

Re: Issues with Form.UnSaved

Also issues with Form.Valid?

Scenario:

- 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. 

image.png

Whats up here? I use .Valid for a lot of things!

Highlighted
Advocate V
Advocate V

Re: Issues with Form.UnSaved

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).

Highlighted
Frequent Visitor

Re: Issues with Form.UnSaved

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

Highlighted
Frequent Visitor

Re: Issues with Form.UnSaved

Ah I see!  Would I have to do this for every data card or could we do this for the form itself?

Highlighted
Frequent Visitor

Re: Issues with Form.UnSaved

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)

Highlighted
Helper V
Helper V

Re: Issues with Form.UnSaved

*bump*

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: 
https://powerapps.microsoft.com/en-us/support/pro/


Highlighted
Frequent Visitor

Re: Issues with Form.UnSaved

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!

Highlighted
Frequent Visitor

Re: Issues with Form.UnSaved

it is definitely related to the default value and the form setting values when bull. I have found this to be a particular problem when there is a date picker and the source value is Null. There is a not very obvious place where the picker inserts a default value. Once removed i did not get the unsaved issue. this can be achieved by doing the following steps Select DateCardValue -> Advanced Tab -> Remove everything in "InputTextPlaceholder" :slightly_smiling_face: now i need to find the same for a toggle 🙂 Kudos to:- @https://powerusers.microsoft.com/t5/Building-Power-Apps/DatePicker-empty-value/td-p/38305
Highlighted
Frequent Visitor

Re: Issues with Form.UnSaved

it is definitely related to the default value and the form setting values when bull. I have found this to be a particular problem when there is a date picker and the source value is Null. There is a not very obvious place where the picker inserts a default value. Once removed i did not get the unsaved issue. this can be achieved by doing the following steps Select DateCardValue -> Advanced Tab -> Remove everything in "InputTextPlaceholder" now i need to find the same for a toggle 🙂 Kudos to:- @https://powerusers.microsoft.com/t5/Building-Power-Apps/DatePicker-empty-value/td-p/38305

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,600)