Mar 10 2018 09:43 AM
Mar 10 2018 09:43 AM
The "special type of PowerApps app" (see Customize a SharePoint list form using PowerApps) used for in-place list forms seems to suffer from two serious validation issues.
1. List validation information is not communicated to form user. Where
the form's behavior is to show the progress indicator for saving, but not to save and not display any error message. In the best case, the form would discover from SharePoint that the updated column's value was invalid and display the user error message provided by SharePoint for that column. Even a generic message that flagged the updated column value as invalid would be helpful.
2. Updated column values are seemingly not available in form data elements during the editing process. To see this, do as follows. In a custom PowerApps form, make the error display element for any datacard visible and assign as its Text value the value of the column data for that element. For example, suppose the list has a column named "Email" exposed on the form through the "Email_DataCard" with an error display element called "EmailErrorMessage". Reference Email in the Text property of EmailErrorMessage and make EmailErrorMessage visible.
Run the form for an existing record. EmailErrorMessage will show the current value of Email. Change the current value. This change will not be reflected in the EmailErrorMessage, even after focus moves off the Email textbox.
If these issues are based on a misunderstanding of expected behavior of the form, please explain. As it stands, these issues seem to severely limit the ability to perform column validation in custom PowerApps forms.
Jul 03 2018 08:55 AM
Microsoft never resolved this issue, even after I reported a likely cause to them. Please see if the work-around below resolves this issue for you. I'd really like to know (a) if this pertains to your situation and (b) if it does, what the result is of using it.
I've now identified the likely cause of this issue. It can be stated as follows: When there are validation formulas on non-required columns, the columns are treated as required. More specifically, it appears that some process executes column validation formulas against empty strings.
The first image below shows the symptom of this: all required columns have valid data, but two optional columns with SharePoint validation formulas, Mobile Number and Email, do not. PowerApps displays a non-specific error message, seemingly about Entry Date.
The second image below shows what happens when Quick Edit is used to attempt to add a new record. This time, probably because the process is within SharePoint, the column validation error message for Mobile Number displays, even though the column is optional and no data has been entered.
To essentially prove that this is the issue, I modified the validation formulas for both Mobile Number and Email, adding an or ISBLANK(<column name>) to each. The revised formulas are:
With the revised formulas I was able to save a new record with only the required columns having data.
Jul 03 2018 10:06 AM
I have a URL column and it is not a required field. It works fine when user does not enter the value. However, it the user enters text (not a URL), it does not save and it does not give an error message. It seems that it is validating if the string is a URL field but does not display the error message.
Jul 03 2018 12:52 PM
According to Types of fields and field data types, a URL field is just a text field with URL formatting and a rule that text entered that doesn't begin with "http://" (or "https://") will have "http://" prepended to it.
What if you add validation in PowerApps that requires a valid URL? In other words, what if you make sure that only syntactically valid URLs are entered before a save action can be performed?
Jul 09 2018 06:14 AM
Issues is not displaying the error message on the validation - when I click on save, it shows dots to save but there is no action. When I go and enter valid url, it saves the form. Did you have issues displaying the error messages for the field validation?
Jul 09 2018 08:05 AM
In my case, PowerApps/SharePoint applied validation to an optional field when it was blank and failed to save. It also failed to display the error message associated with the field. The validation that created this problem was in SharePoint. I resolved this problem by adding a clause to the SharePoint validation to accept an empty string.
I did not have a problem with not showing an error message for an invalid field where the validation was in PowerApps.
I'm on vacation this week so may not be able to respond further until next Monday.