Special properties
Forms have a couple of overlooked properties and named operators. This section covers when and how to use the Error property, Unsaved property, ThisItem named operator, and Parent named operator.
Error property
The Error property contains the output of any error messages that are generated by the Form control. To view the contents of the property, add a Text label control to the screen and then for the Text property enter the formula Form1.Error. It’s blank if there’s no error, but if you try to submit a form without entering all of the required columns you would see a message such as “An entry is required or has an invalid value. Correct and try again.” You can use this value in formulas or other controls to design your apps error handling.
Unsaved property
The Unsaved property is a Boolean property that is true when a form has been edited but not submitted. You can use this property to check to see if the user has unsaved change. An example of this would be to set up the back button on your app to check to see if the form was unsaved, if there’s unsaved data then don’t navigate. You could use the following formula in the OnSelect property of a Button control to achieve this.
PowerApps Formula
If(YourFormName.Unsaved = false, Navigate(WelcomeScreen, ScreenTransition.Cover))
This function would check to see if the Form control named YourFormName had false for the Unsaved property. If the property is false, then it would navigate the user to the screen named WelcomeScreen. If the property is true, then nothing would happen. In your app, you could expand upon this concept to add a warning message or even a popup box telling the user why they couldn’t navigate away.
In addition to these properties, the Form control includes the named operators, ThisItem and Parent, like the Gallery control.