By default, a canceled or rescheduled Calendly event is not deleted from your Microsoft Dynamics calendar. Instead, the Power Automate flow updates the existing event title and description with the word Canceled.
However, if you no longer want the event in Microsoft Dynamics due to too many records, you can modify your Cancel an appointment when a Calendly event is canceled flow to automatically delete an event record by completing the steps below.
How to delete an event record in Microsoft Dynamics when a Calendly event is canceled or rescheduled
- Open Create and update a lead when a Calendly event is created flow to modify. It is also good practice to duplicate the flow and modify that in case you wish to revert any changes.
- Insert a new action before the Does a lead exist action and after Does owner exist. Search for control and add condition branch.
- Rename the control to something appropriate, such as "Is a reschedule".
- Add the function by selecting the fx icon in the first box and copy the line as shown below.
- In the last box, enter "true".
- Add a note under the true branch and search for "dataverse get" and select Get row by ID.
- Rename the note to "Find Old Appointment". Matching the exact name is crucial here as it is used by the next node "set old owner id" in step 13.
- Add the function by selecting the fx icon in the Value box and copy the line as shown below.
- Add OwnerId, ActivityId to "Select Columns box".
- Add a node after "Find Old Appointment" and search for "set variable".
- Rename the node to "Set Old Owner ID".
- Select Owner ID under Name dropdown.
- Add the function by selecting the fx icon in the Value box and copy the line as shown below.
- Add a node after "Set Old Owner ID" and search for "dataverse delete".
- Rename the node to "Delete Old Appointment".
- Select Appointments under table name dropdown.
- Add the function by selecting the fx icon in the Row ID box and copy the line as shown below.
- Save in the top right menu bar.
How to test results
You can test to see if your new flow is working by scheduling an event and viewing the event in Microsoft Dynamics.
Ensure that any old flows are deactivated, this flow is activated, and select Test > Manually > Test in the top right menu board while editing the flow.
Then, within your Calendly account, you can reschedule a test event. In your flow, check that the flow passed successfully and that the Microsoft Dynamics event has the updated info and owner.