Forum Discussion
Customize Forms Using PowerApps: Validation Issues
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.