cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cooper333
New Member

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
Community Support

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
Community Support

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
secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (7,033)