web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / On Validate why the si...
Power Apps
Answered

On Validate why the site column validation message not displayed

(0) ShareShare
ReportReport
Posted on by 1,594

I have customized a SharePoint list form. In that list there is a field that has a validation rule and a validation message "There must be at least 4 characters".

I set the OnSave event of the SharePointIntegration control like this:

 

Validate(Salariés;"scECTRAdrCP";DataCardValue20.Text);;SubmitForm(SharePointForm1)

"scECTRAdrCP" is the field and DataCardValue20 is the text box for that field.

 

When I create a new item in the list, if I enter less than 4 characters in the field, the following message is displayed:

 

Image 2.png

 

If I try to save again, then the following message is displayed:

 

Image 1.png

 

Why isn't just the validation message of the field displayed ? That is "There must be at least 4 characters"...

Categories:
  • Rebetcha Profile Picture
    645 on at

    I have tried out your scenario in some different ways. First I started out with simply using the default form. You cannot save the item in that case but the error message is technical and not the message defined in the list collumn. 

    Next I tried different functions (Validate, IfErrors, Notify).

    My end conclusion is that the validation you are doing in this collumn is not something that can be validated correctly by PowerApps with the Validate function. The fact that the error message was not shown by submitting the default form was my first hint. The info of the DataSourceInfo function gave me the second clue. The DataSourceInfo provides the same information as output that the Validate function uses to validate. In the description of this function a lot of validations are described. Minimum length is not one of them. 

    When there is no column level validation possible the data source still provides information if the item could be created. But those errors are very general. Because this type of validation cannot be done, the form will be submitted but will result in a general error.

    Your best way forward I think is to put your validation also somwhere inside the form. Perhaps by adding an If-function to the OnSave of the SharePoint integration Notify with an error in case the field has less than 4 characters instead of submitting the form. 

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @R3dKap,

     

    Could you please share a bit more about the validation rule and the validation message within your SP list?

     

    I have made a test and the issue is confirmed on my side. The error message (first error) shows up as below:

    There was a problem saving your changes. The data source may be invalid.

    I also added a Button control within the app, and set the OnSelect property to following formula:

    Validate('20180802_case8',"EmployeeName",DataCardValue2.Text)

    When entering less than 4 characters in the field and then clicking this Button, no error message shows up.

     

    Currently, I afraid that the validation rule of SP list could not be supported within PowerApps. As an alternative solution, you could take a try to achieve your validation needs within your app.

     

    I have made a test on my side, please take a try with the following workaround:

     

    Set the OnSave property of the SharePointIntegration control to following formula:

    If(
    Len(DataCardValue2.Text)<4,
    Notify("There must be at least 4 characters at EmployeeName field!",NotificationType.Error),
    SubmitForm(SharePointForm1)
    )

    On your side, type the following formula:

    If(
     Len(DataCardValue20.Text)<4,
     Notify("There must be at least 4 characters at scECTRAdrCP field!",NotificationType.Error),
     SubmitForm(SharePointForm1)
    )

    The GIF image as below:Test1.gif

     

     

     

     

    Best regards,

    Kris

     

  • R3dKap Profile Picture
    1,594 on at

    @Rebetcha, thanks for your thourough analysis...

     

    @v-xida-msft, that's what I ended up doing finally... although I didn't know the Notify function which will be very helpfull... Thx !

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard