Forum Discussion
Customize Forms Using PowerApps: Validation Issues
I am having the same issue - any update on this?
Thanks
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:
- Mobile Number: =OR(AND(LEN([Mobile Number])=12,IF(LEFT([Mobile Number],2)="+1",TRUE,FALSE),IF(ISNUMBER(RIGHT([Mobile Number],10)+0),TRUE,FALSE)),ISBLANK([Mobile Number]))
- Email: =OR(AND(ISERROR(FIND("",Email,1)),IF(ISERROR(FIND("@",Email,2)),FALSE,AND(ISERROR(FIND("@",Email,FIND("@",Email,2)+1)),IF(ISERROR(FIND(".",Email,FIND("@",Email,2)+2)),FALSE,FIND(".",Email,FIND("@",Email,2)+2)<LEN(Email))))),ISBLANK(Email))
With the revised formulas I was able to save a new record with only the required columns having data.
- Pug603Sep 26, 2022Copper ContributorMy experience with data validation is that it will act as a field requirement (without the messaging specifying as much) unless you specify that blanks are also acceptable.
- Suseela KodaliJul 03, 2018Copper Contributor
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.
- Joseph BolandJul 03, 2018Brass Contributor
According to https://docs.microsoft.com/en-us/dynamics365/customer-engagement/customize/types-of-fields, 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?
- Suseela KodaliJul 09, 2018Copper Contributor
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?