cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cooper333
Level: Power Up

PowerApps form errors when SharePoint list has Column Validation

I customized a form form a SharePoint list. The form submits correctly. Then I added validation to the SharePoint field itself because I want the rule to apply when I submit an item through a datasheed edit view. I was planning on adding the same validation on the form. However, I tested the submit before adding and now it is not working. The error message I am getting is 

The requested operation is invalid. Server Response: List data validation failed. clientRequestId: {guid} serviceRequestId: {guid}

The rule I have on my field is on the Title field which was renamed to Code

NOT(LEN([Code]))=3

I only want users to be able to submit a 3 character code

Does anyone know why this would affect the PowerApps form? I am submitting a 3 character code

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: PowerApps form errors when SharePoint list has Column Validation

Hi @cooper333 ,

Do you only want the users to be able to submit a 3 character code?

 

If you only want the users to be able to submit a 3 character code, I think there is something wrong with your Validation Rule in the Title filed in your SP list.

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

Set the Validation formula box to following:

=(LEN([StHobbsM])=3)

On your side, you should type:

=(LEN([Code])=3)

When you do not submit a 3 character code within your Edit form, the following error message would show up:4.JPG

 

In addition, you could also consider add same validation on your Edit form. I have made a test on my side, please take a try with the following workaround:5.JPG

Within the Edit form, unlock the StHobbsM Data card, then set the Text property of the ErrorMessage13 Label to following:

If(Len(DataCardValue17.Text)<>3, "You typed a invalid value here!")

On your side, you should unlock the Title (or Code) Data card, then set the Text property of the ErrorMessage Label to following:

If(Len(DataCardValue1.Text) <> 3, "You typed a invalid value here!")

Note: The DataCardValue1 represents the Text Input box within the Title (or Code) Data card.

Please take a try with above solution, check if the issue is solved.

 

Actually, I think it is not necessary to add a set a Column Validation within your SP list data source, instead, you could achieve your validation within the Edit form of your app. If the validation could not pass within your EDIT Form, you could not submit the form data.

Note: I also made a test, if you use Patch function to patch data into your SP list, you must provide a proper value the Code column, otherwise, the Patch would not work.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: PowerApps form errors when SharePoint list has Column Validation

Hi @cooper333 ,

Do you only want the users to be able to submit a 3 character code?

 

If you only want the users to be able to submit a 3 character code, I think there is something wrong with your Validation Rule in the Title filed in your SP list.

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

Set the Validation formula box to following:

=(LEN([StHobbsM])=3)

On your side, you should type:

=(LEN([Code])=3)

When you do not submit a 3 character code within your Edit form, the following error message would show up:4.JPG

 

In addition, you could also consider add same validation on your Edit form. I have made a test on my side, please take a try with the following workaround:5.JPG

Within the Edit form, unlock the StHobbsM Data card, then set the Text property of the ErrorMessage13 Label to following:

If(Len(DataCardValue17.Text)<>3, "You typed a invalid value here!")

On your side, you should unlock the Title (or Code) Data card, then set the Text property of the ErrorMessage Label to following:

If(Len(DataCardValue1.Text) <> 3, "You typed a invalid value here!")

Note: The DataCardValue1 represents the Text Input box within the Title (or Code) Data card.

Please take a try with above solution, check if the issue is solved.

 

Actually, I think it is not necessary to add a set a Column Validation within your SP list data source, instead, you could achieve your validation within the Edit form of your app. If the validation could not pass within your EDIT Form, you could not submit the form data.

Note: I also made a test, if you use Patch function to patch data into your SP list, you must provide a proper value the Code column, otherwise, the Patch would not work.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,689)