Customize Forms Using PowerApps: Validation Issues

%3CLINGO-SUB%20id%3D%22lingo-sub-170122%22%20slang%3D%22en-US%22%3ECustomize%20Forms%20Using%20PowerApps%3A%20Validation%20Issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-170122%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20%22special%20type%20of%20PowerApps%20app%22%20(see%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowerapps%2Fcustomize-list-form%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3ECustomize%20a%20SharePoint%20list%20form%20using%20PowerApps%3C%2FA%3E)%20used%20for%20in-place%20list%20forms%20seems%20to%20suffer%20from%20two%20serious%20validation%20issues.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1.%20List%20validation%20information%20is%20not%20communicated%20to%20form%20user.%26nbsp%3B%20Where%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EThe%20SharePoint%20list%20column%20has%20a%20validation%20formula%20and%20user%20message%2C%3C%2FLI%3E%0A%3CLI%3Einvalid%20data%20is%20entered%20for%20that%20column%20in%20the%20custom%20form%2C%20and%3C%2FLI%3E%0A%3CLI%3Ethe%20form's%20Save%20button%20is%20clicked%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3Ethe%20form's%20behavior%20is%20to%20show%20the%20progress%20indicator%20for%20saving%2C%20but%20not%20to%20save%20and%20not%20display%20any%20error%20message.%26nbsp%3B%20In%20the%20best%20case%2C%20the%20form%20would%20discover%20from%20SharePoint%20that%20the%20updated%20column's%20value%20was%20invalid%20and%20display%20the%20user%20error%20message%20provided%20by%20SharePoint%20for%20that%20column.%26nbsp%3B%20Even%20a%20generic%20message%20that%20flagged%20the%20updated%20column%20value%20as%20invalid%20would%20be%20helpful.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E2.%20Updated%20column%20values%20are%20seemingly%20not%20available%20in%20form%20data%20elements%20during%20the%20editing%20process.%26nbsp%3B%20To%20see%20this%2C%20do%20as%20follows.%26nbsp%3B%26nbsp%3BIn%20a%20custom%20PowerApps%20form%2C%20make%20the%20error%20display%20element%20for%20any%20datacard%20visible%20and%20assign%20as%20its%20Text%20value%20the%20value%20of%20the%20column%20data%20for%20that%20element.%20For%20example%2C%20suppose%20the%20list%20has%20a%20column%20named%20%22Email%22%20exposed%20on%20the%20form%20through%20the%20%22Email_DataCard%22%20with%20an%20error%20display%20element%20called%20%22EmailErrorMessage%22.%20Reference%20Email%20in%20the%20Text%20property%20of%20EmailErrorMessage%20and%20make%20EmailErrorMessage%20visible.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F30066i2DCE7376CDA558A8%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22Set_element_error_display_to_element.PNG%22%20title%3D%22Set_element_error_display_to_element.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERun%20the%20form%20for%20an%20existing%20record.%20EmailErrorMessage%20will%20show%20the%20current%20value%20of%20Email.%20Change%20the%20current%20value.%20This%20change%20will%20not%20be%20reflected%20in%20the%20EmailErrorMessage%2C%20even%20after%20focus%20moves%20off%20the%20Email%20textbox.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F30068i6D191EA64EFA1C3B%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22Non-updating_PowerApps_form_element.PNG%22%20title%3D%22Non-updating_PowerApps_form_element.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20these%20issues%20are%20based%20on%20a%20misunderstanding%20of%20expected%20behavior%20of%20the%20form%2C%20please%20explain.%26nbsp%3B%20As%20it%20stands%2C%20these%20issues%20seem%20to%20severely%20limit%20the%20ability%20to%20perform%20column%20validation%20in%20custom%20PowerApps%20forms.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-170122%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowerApps%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-213369%22%20slang%3D%22en-US%22%3ERe%3A%20Customize%20Forms%20Using%20PowerApps%3A%20Validation%20Issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-213369%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20my%20case%2C%20PowerApps%2FSharePoint%20applied%20validation%20to%20an%20optional%20field%20when%20it%20was%20blank%20and%20failed%20to%20save.%26nbsp%3B%20It%20also%20failed%20to%20display%20the%20error%20message%20associated%20with%20the%20field.%26nbsp%3B%20The%20validation%20that%20created%20this%20problem%20was%20in%20SharePoint.%26nbsp%3B%20I%20resolved%20this%20problem%20by%20adding%20a%20clause%20to%20the%20SharePoint%20validation%20to%20accept%20an%20empty%20string.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20did%20not%20have%20a%20problem%20with%20not%20showing%20an%20error%20message%20for%20an%20invalid%20field%20where%20the%20validation%20was%20in%20PowerApps.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20on%20vacation%20this%20week%20so%20may%20not%20be%20able%20to%20respond%20further%20until%20next%20Monday.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-213331%22%20slang%3D%22en-US%22%3ERe%3A%20Customize%20Forms%20Using%20PowerApps%3A%20Validation%20Issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-213331%22%20slang%3D%22en-US%22%3E%3CP%3EIssues%20is%20not%20displaying%20the%20error%20message%20on%20the%20validation%20-%20when%20I%20click%20on%20save%2C%20it%20shows%20dots%20to%20save%20but%20there%20is%20no%20action.%26nbsp%3B%20When%20I%20go%20and%20enter%20valid%20url%2C%20it%20saves%20the%20form.%26nbsp%3B%20Did%20you%20have%20issues%20displaying%20the%20error%20messages%20for%20the%20field%20validation%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-211841%22%20slang%3D%22en-US%22%3ERe%3A%20Customize%20Forms%20Using%20PowerApps%3A%20Validation%20Issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-211841%22%20slang%3D%22en-US%22%3E%3CP%3EAccording%20to%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdynamics365%2Fcustomer-engagement%2Fcustomize%2Ftypes-of-fields%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3ETypes%20of%20fields%20and%20field%20data%20types%3C%2FA%3E%2C%20a%20URL%20field%20is%20just%20a%20text%20field%20with%20URL%20formatting%20and%20a%20rule%20that%20text%20entered%20that%20doesn't%20begin%20with%20%22http%3A%2F%2F%22%20(or%20%22https%3A%2F%2F%22)%20will%20have%20%22http%3A%2F%2F%22%20prepended%20to%20it.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20if%20you%20add%20validation%20in%20PowerApps%20that%20requires%20a%20valid%20URL%3F%26nbsp%3B%20In%20other%20words%2C%20what%20if%20you%20make%20sure%20that%20only%20syntactically%20valid%20URLs%20are%20entered%20before%20a%20save%20action%20can%20be%20performed%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-211784%22%20slang%3D%22en-US%22%3ERe%3A%20Customize%20Forms%20Using%20PowerApps%3A%20Validation%20Issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-211784%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20URL%20column%20and%20it%20is%20not%20a%20required%20field.%20%26nbsp%3B%20It%20works%20fine%20when%20user%20does%20not%20enter%20the%20value.%26nbsp%3B%26nbsp%3B%20However%2C%20it%20the%20user%20enters%20text%20(not%20a%20URL)%2C%20it%20does%20not%20save%20and%20it%20does%20not%20give%20an%20error%20message.%26nbsp%3B%20It%20seems%20that%20it%20is%20validating%20if%20the%20string%20is%20a%20URL%20field%20but%20does%20not%20display%20the%20error%20message.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-211756%22%20slang%3D%22en-US%22%3ERe%3A%20Customize%20Forms%20Using%20PowerApps%3A%20Validation%20Issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-211756%22%20slang%3D%22en-US%22%3E%3CP%3EMicrosoft%20never%20resolved%20this%20issue%2C%20even%20after%20I%20reported%20a%20likely%20cause%20to%20them.%26nbsp%3B%20Please%20see%20if%20the%20work-around%20below%20resolves%20this%20issue%20for%20you.%26nbsp%3B%20I'd%20really%20like%20to%20know%20(a)%20if%20this%20pertains%20to%20your%20situation%20and%20(b)%20if%20it%20does%2C%20what%20the%20result%20is%20of%20using%20it.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E-----------%3C%2FP%3E%3CP%3EI've%20now%20identified%20the%20likely%20cause%20of%20this%20issue.%26nbsp%3B%20It%20can%20be%20stated%20as%20follows%3A%26nbsp%3B%20When%20there%20are%20validation%20formulas%20on%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CU%3Enon-required%3C%2FU%3E%26nbsp%3Bcolumns%2C%20the%20columns%26nbsp%3Bare%20treated%20as%20required.%26nbsp%3B%20More%20specifically%2C%20it%20appears%20that%20some%20process%20executes%20column%26nbsp%3Bvalidation%20formulas%20against%20empty%20strings.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20first%20image%20below%20shows%20the%20symptom%20of%20this%3A%26nbsp%3B%20all%20required%20columns%26nbsp%3Bhave%20valid%20data%2C%20but%20two%20optional%20columns%20with%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CU%3ESharePoint%26nbsp%3B%3C%2FU%3Evalidation%20formulas%2C%20Mobile%20Number%20and%20Email%2C%20do%20not.%26nbsp%3B%20PowerApps%20displays%20a%20non-specific%20error%20message%2C%20seemingly%20about%20Entry%20Date.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20second%20image%20below%20shows%20what%20happens%20when%20Quick%20Edit%20is%20used%20to%20attempt%20to%20add%20a%20new%20record.%26nbsp%3B%20This%20time%2C%20probably%20because%20the%20process%20is%20within%20SharePoint%2C%20the%20column%20validation%20error%20message%20for%20Mobile%20Number%20displays%2C%20even%20though%20the%20column%20is%20optional%20and%20no%20data%20has%20been%20entered.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20essentially%20prove%20that%20this%20is%20the%20issue%2C%20I%20modified%20the%20validation%20formulas%20for%20both%20Mobile%20Number%20and%20Email%2C%20adding%20an%20or%20ISBLANK(%3CCOLUMN%20name%3D%22%22%3E)%20to%20each.%26nbsp%3B%20The%20revised%20formulas%20are%3A%3C%2FCOLUMN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3EMobile%20Number%3A%26nbsp%3B%3CSPAN%3E%3DOR(AND(LEN(%5BMobile%20Number%5D)%3D12%2CIF(LEFT(%5BMobile%20Number%5D%2C2)%3D%22%2B1%22%2CTRUE%2CFALSE)%2CIF(ISNUMBER(RIGHT(%5BMobile%20Number%5D%2C10)%2B0)%2CTRUE%2CFALSE))%2CISBLANK(%5BMobile%20Number%5D))%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3EEmail%3A%20%3DOR(AND(ISERROR(FIND(%22%3C%2FSPAN%3E%3CDIV%3E%26nbsp%3B%22%2CEmail%2C1))%2CIF(ISERROR(FIND(%22%40%22%2CEmail%2C2))%2CFALSE%2CAND(ISERROR(FIND(%22%40%22%2CEmail%2CFIND(%22%40%22%2CEmail%2C2)%2B1))%2CIF(ISERROR(FIND(%22.%22%2CEmail%2CFIND(%22%40%22%2CEmail%2C2)%2B2))%2CFALSE%2CFIND(%22.%22%2CEmail%2CFIND(%22%40%22%2CEmail%2C2)%2B2)%3CLEN%3E%3CP%3EWith%20the%20revised%20formulas%20I%20was%20able%20to%20save%20a%20new%20record%20with%20only%20the%20required%20columns%20having%20data.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20661px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F37053i4BD3ACBFD4CED696%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22PowerApps_SharePoint_validation1.png%22%20title%3D%22PowerApps_SharePoint_validation1.png%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F37054i918EA3D995BAC375%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22PowerApps_SharePoint_validation2.png%22%20title%3D%22PowerApps_SharePoint_validation2.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLEN%3E%3CLINGO-SUB%20id%3D%22lingo-sub-211690%22%20slang%3D%22en-US%22%3ERe%3A%20Customize%20Forms%20Using%20PowerApps%3A%20Validation%20Issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-211690%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20having%20the%20same%20issue%20-%20any%20update%20on%20this%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3C%2FDIV%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

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

  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.

 

Set_element_error_display_to_element.PNG

 

 

 

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.

 

Non-updating_PowerApps_form_element.PNG

 

 

 

 

 

 

 

 

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.

 

6 Replies
Highlighted

I am having the same issue - any update on this?

 

Thanks

Highlighted

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.

 

PowerApps_SharePoint_validation1.pngPowerApps_SharePoint_validation2.png

Highlighted

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. 

Highlighted

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?

Highlighted

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?

Highlighted

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.