cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EthanSSEH
Frequent Visitor

Http Request Error Help - Sharepoint Calendar - Restore previous version of an event

Hi all,

 

I can not seem to usethis request to restore my SP calendar event back to a previous version.

https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/listitemversion_restore?view=odsp-g...

 

I have tried various versions but have been unable to make the event go back to a previous version without getting errors 401 and 400.

 

Can anybody advise on what I am doing wrong?

 

Thanks

Ethan

 

Please see requests screenshot below.

q2.PNG

5 REPLIES 5
EthanSSEH
Frequent Visitor

This is the current error.
 
{
"status": 400,
"message": "The expression \"web/sites/('XX')/lists/('XX XX')/items/('91')/versions/('3.0')/restoreVersion\" is not valid.\r\nclientRequestId: b02e661c-a3d6-4005-b70d-3ea53dbf4d57\r\nserviceRequestId: 63cbfb9e-401e-1000-c738-adc65d354b59",
"source": "https://XX.sharepoint.com/sites/XX/_api/web/sites/('XX')/lists/('XX%20XX')/items/('91')/versions/('3.0')/restoreVersion",
"errors": [
"-1",
"Microsoft.SharePoint.Client.InvalidClientQueryException"
]
}

Hi @EthanSSEH,

 

Please have a try with the following operation:

_api/web/GetFolderByServerRelativeUrl('library')/Files('document')/Versions/restoreByLabel('VersionLabel')

Annotation 2019-08-20 134401.png

I hope it helps.

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

Hi,

 

REFERENCING: ..com/sites/ABC/Lists/XYZ/calendar.aspx

 

I tried this solution taking ABC as the Library and XYZ as the file. I think this reverts the whole calendar to a previous version which is not what I want to do.

 

I have a calendar stored in site contents and I am looking to use the patch request to restore a previous version of any item that is modified if the modification is rejected. The idea is that if somebody modifies an event in the calendar and that identification is rejected it is automatically reverted to its previous version.

 

How would I use the above to tackle this?

 

 

 

 

 

 

Hi @EthanSSEH,

 

The events of the calendar are stored as list items in SharePoint. Currently, the SharePoint connector gets the latest information of the list items and has no way to get the previous value of the item. As a workaround, I recommend saving the information elsewhere to display that you want to achieve.

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

You can restore a file in a documnet library fine with /restoreLabel('2.0') - but cannot seem to do it on a list item... has anyone found a way to restore a list item ? 

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Top Solution Authors
Users online (2,032)