I have a strange situation I can't seem to figure out.
I have a calendar app that allows staff members to record events on a calendar.
For some strange reason, it wont allow me to edit the end date, unless I edit the start date as well.
If I simply edit the end date, it returns the following error on screen.
"an error occurred on the server"
When I look into the chrome dev tools logs..I see the following error under the network tab.
"Invalid data has been used to update the list item. The field you are trying to update may be read only"
Any ideas what may the reason for this?
I can confirm that my colmn names are accurate and match.
I am also able to create an item with no problem, this only occurs when I try to edit an item.
It feels as if there is some codependency between the start and end date fields, but I cant seem to find the relationship between the two fields. I also must discplose that my Sharepoint list is a calendar list type.
Solved! Go to Solution.
I have not heard anything new one this. I was not able to update the record with a Patch command either. Can't figure out whats goin on here!
Patch Function also gives the same error. I used your workaround to add a 'millisecond' to the Start Date and that did the trick. Note: Adding Milliseconds instead of Minutes is better since this change is not visible to users.
Hi @esoPowerUser and all,
I have a similar issue. I tried to add 1 second to both 'Start time' and 'End time' [the 2 fields that I need to update to avoid the Network error though they are Optional in SP list and not "Required" fields in Power Apps!]. I don't get the network error now when I just update 1 of them! If I just change the End Time [w/o changing the Start time], things are good [no error, everything gets updated in the App and in SP list]. But if I only update 'Start Time', i don't get any Network error, but the event is gone from the Power Apps "Existing events" view [there is a Calendar that shows all existing events, from which i click 1 event to update]. As I check the SP list, I see the "Start Time" Column value gets blank [the previous value is gone]!
I have 2 variables: varMeetingStartUpdated and varMeetingEndUpdated that I assign the 'Start Time' and 'End Time' from the Form [that user may have updated] and then pass it to a Patch() later after another "OK to update" button is clicked. The SP list gets updated at that time. Here is the code snippet:
Set(varMeetingStartUpdated,DateValue_Edit.SelectedDate + Time(Value(HourValue_Edit.Selected.Value), Value(MinuteValue_Edit.Selected.Value), 1));
Set(varMeetingEndUpdated,DateValueEnd_Edit.SelectedDate + Time(Value(HourValueEnd_Edit.Selected.Value), Value(MinuteValueEnd_Edit.Selected.Value), 1));
Does anyone have any idea? Driving me nuts! 😞 Thanks!
Hi - did you manage to fix this issue? I am running into the exact same problem when working with a SP Calendar list. I tried using the Patch function but same result unless you also change the startdate. Curious to learn if you ever arrived at a solution. Thanks!
Actually - re-reading the comments on this thread, I used the DateAdd formula into the Update property for StartDate and fixed the issue, as such:
DateAdd(DateValue2.SelectedDate + Time(Value(HourValue2.Selected.Value), Value(MinuteValue2.Selected.Value), 0),1,Milliseconds).
That fixed the issue!