cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mccallaj
Level: Powered On

Runtime Error: The requested operation is invalid

Server Response:  The string was not recognized as a valid DateTime.  There is an unknown word starting at index 1.  clientRequestId: ….. serviceRequestId:….

 

This error appears under the “OnSelect” property of my save button.  The formula in the save button is SubmitForm(SharePointForm2).  Restoring a previous version did not help. 

 

The app is a program plan.  When a program is selected from a dropdown, the required classes populate in the form fields below.  When the classes populate, the credits earned for those classes are populated in a column next to the class.  There are fields that calculate based on if the class has been taken by the student.

 

There are only a few date fields.  Those fields are populated by a flow that is triggered by a different button, so they are empty at this time.  Populating the fields did not fix the issue either.

1 REPLY 1
Community Support Team
Community Support Team

Re: Runtime Error: The requested operation is invalid

Hi @mccallaj,

Could you please share more details about the error message within your app?

Could you please show more details about the date time field in your SP List? Is it a Date time type column or Date only type column?

 

I have made a test on my side, and don't have the issue that you mentioned. Based on the error message that you mentioned, I suppose that you add a Date time type field (not Date only type) within your SP List, is it true?

 

Please also check if you have set the Display format of your Date time field in your SP List to "Friendly". If you have set the Display format of your Date time field in your SP List to "Friendly", you may face this issue. Please consider set the Display format of the Date time filed to "Standard", then check if the issue is solved.

The user @LanceL has given his solution about this issue, please check the following thread:

https://powerusers.microsoft.com/t5/Creating-Apps/String-not-recognised-App-working-for-me-but-not-c...

 

3.JPG

 

In addition, also please consider submit your form data using Patch function instead of SumitForm() function, then check if the issue is solved. Set the OnSelect property of the "Submit" button to following:

If(
   SharePointForm2.Mode = FormMode.New,
    Patch(
             'YourSPList',
             Defaults('YourSPList'),
             {
                   Title: TitleDataCard.Text,
                   Column2: DataCardValue2.Text,
                   ...
             }
    ),
   Patch(
          'YourSPList',
            SharePointIntegration.Selected,
           {
               Title: TitleDataCard.Text,
                Column2: DataCardValue2.Text,
                   ...
           }
   )
)

Please consider take a try with above solution, then check if the issue is solved. If the issue still exists, please consider remove the Date time field from your SP list, and re-create a new one. Then remove the custom form from your SP list, then re-create a new one, check if the issue still exists.

 

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.