Forum Discussion

Joseph Boland's avatar
Joseph Boland
Brass Contributor
Mar 10, 2018

Customize Forms Using PowerApps: Validation Issues

The "special type of PowerApps app" (see https://docs.microsoft.com/en-us/powerapps/customize-list-form) 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

  1. The SharePoint list column has a validation formula and user message,
  2. invalid data is entered for that column in the custom form, and
  3. the form's Save button is clicked

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.

 

7 Replies

    • Joseph Boland's avatar
      Joseph Boland
      Brass Contributor

      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.

       

      • Pug603's avatar
        Pug603
        Copper Contributor
        My 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.

Resources