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

If conditions are met, restore previous version of sharepoint calendar event using Sharepoint HTTP Request

Hi all,

 

*PLEASE EXCUSE the cluttery start to my flow, I was experimenting with a few different options for this problem early on and it still needs cleaning up*

 

I currently have a flow which looks for modifications in events within a sharepoint calendar (when an item is created or modified). Content approval is active on this calendar so therefore once a changed is made the status of the event is turned to pending. The aim of the flow is to automate the event editing process, such that if changes are approved or denied they are automatically updated or restored to their previous version with no manual input in the SP calendar.

 

The approval side is easy enough. The rejection side is proving challenging.. 

 

Current Flow State:

The flow spots a change or event creation and triggers.

 

Using a HTTP request I have been able to extract the {ModerationStatus} of the event and I have set this as a condition in the flow such that if ModStatus = 2 (pending) it will start an approval request. I have done this by writing the status to excel, and setting up an IF statement converting the numbers into their appropriate state.

 

My idea from here was to use a condition stating if the approval status was "reject" the event should be reverted back to its previous version. I have seen people use a similar method to perform similar operations.

 

Using excel I was able to get the (version number - 1.0) but was at a complete loss when trying to get this to restore that version number via HTTP request. I need the end of my flow, if the approval status is "reject", to revert the event back to its previous version so that there is no-need for manual restoration via the sharepoint site.

 

I think the issue is occuring due to my of knowledge in how to populate the rows below.

My questions are:

1) Using this flow can I and how do I restore an the (n-1) version of the event?

2) If I need to use the HTTP request to do the above, how do I do it?

How do I populate this?How do I populate this?

The rest of the flow is shown below (I had to colour out some details for obvious reasons), but any help would be massively appreciated!

 

 

flowpt1.PNGflowpt2.PNGflowpt3.PNG

 

 

1 REPLY 1
Community Support
Community Support

Hi @EthanSSEH,

 

Maybe Reverted back to its previous version you can have a reference on this post - Restore previous document version and delete current on SharePoint:

https://powerusers.microsoft.com/t5/Building-Flows/Restore-previous-document-version-and-delete-curr...

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.

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (5,099)