cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Phineas
Post Partisan
Post Partisan

Server Error on Patch

I am getting the following error all of a sudden when I Patch data to the server. There are actually two patches in the condition; one sends data to the List the other send the document to the Library. The Library patch is working fine.

I am only getting the error to the List. It wasn't happening a week ago.

 

When I click in 'OnSelect' to check the error the entire patch is RED. Once I click out all the error goes away.

However, if I try to submit another same thing all over again.

 

Error:
          The requested operation in invalid. Server Response: List failed: The string was not recognized as a valid DateTime.

          There is an unknown word starting at index 1. Client…..

1 ACCEPTED SOLUTION

Accepted Solutions

@Phineas ,

@zmorek is correct on the Value() around the data picker not being required (it is already a date), but if you are patching a new record here, you need the Defaults() syntax (which is what @BCLS776 was alluding to)

Patch(
   'Member List and Qualifications',
   Defaults('Member List and Qualifications'),
   {
      Title: . . .  .
   }
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

10 REPLIES 10
zmorek
Power Participant
Power Participant

Can you share your patch statement?

It's a little lengthy, but here's the meat of it. Since the error keeps calling out a date/time issue I made sure to include all the data fields are a minimum. Seems this didn't starting happening until I added a DueDate field in the Power Apps Gallery that tallies the date due for the next based on the date entered into the 'Date of Award'.

Both fields are DatePickers (with the DueDate being auto-populated), and are date fields in the List.

Submit Button 'OnSelect':

     Patch('List',
             {    Title: Title.Text,
             YrofCert: Value(YearofCert.Text). - This is a TextInput Field that pull the year from the 'DateOfCQ'

             DateOfCQ: Value(DateOfCQ.SelectedDate), - This is a DatePicker with " " in the default, but the date is                                                                                             never blank

                                                    
             DueDate: Value(DueDate.SelectedDate),       - A DatePicker with a calculation in the Default. I've confimed                                                                                        with a label that the calcution works and populates the

                                                                                      correct date
             LastEdit: Value(LastEdit.SelectedDate)           - A DatePicker with Today() in the Default property.

}

);

             

BCLS776
Community Champion
Community Champion

There is a period at the end of this statement: YrofCert: Value(YearofCert.Text).

 

Is that the current syntax for your region? I would have expected a comma.

 

Edit: In addition, Patch() requires three arguments unless you are merging records

I apologize; that was my fat fingers. 

 

There is no '.' at the end of DteOfCQ in the actual formula.

 

Here is the Patch...

 

Patch Error.JPG

BCLS776
Community Champion
Community Champion

Is the error mentioning something about Patch() has two arguments, but three expected? If not, please share the error message.

 

When I click in 'OnSelect' to check the error the entire patch is RED. Once I click out of the Gallry the error goes away.

 

Error:
          "The requested operation in invalid. Server Response: List failed: The string was not recognized as a valid

          DateTime. There is an unknown word starting at index 1. Client….."

zmorek
Power Participant
Power Participant

If you remove the Value() from each of the datepicker fields, does the patch work? Does it work with DateValue()?

Tried it eight ways from Sunday yesterday. Every configuration kicked back the same error.

However, I got up this morning. Rebooted everything, got the 'new schema and variable' message on start. Approved the update, tried to load several documents, everything worked fine.

Something happened overnite (some form of change or update), and now the error is gone.

I'm monitoring the situation.

@Phineas ,

@zmorek is correct on the Value() around the data picker not being required (it is already a date), but if you are patching a new record here, you need the Defaults() syntax (which is what @BCLS776 was alluding to)

Patch(
   'Member List and Qualifications',
   Defaults('Member List and Qualifications'),
   {
      Title: . . .  .
   }
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,417)