Handle update/delete events in sharepoint list while syncing with dataverse
To handle update and delete events in a SharePoint list, you can create a Microsoft Power Automate flow. Here are the steps:
- Open Microsoft Power Automate and create a new flow.
- Choose the “SharePoint” connector and select the “When an item is created, modified or deleted” trigger.
- Sign in to your SharePoint account and select the site where your list is located. Then, select the list that you want to monitor for update and delete events.
- Add a “Condition” action to your flow to check the value of the “TriggerBody()” expression. This expression returns the data for the item that triggered the flow.
- Use the “TriggerBody()?[‘EventType’]” expression to determine whether the item was created, modified or deleted.
- If the item was modified or deleted, you can perform additional actions such as sending an email notification or updating another list or system with the changes.
- If the item was deleted, you can use the “Delete item” action from the SharePoint connector to delete the item from your list.
- Save and test your flow to ensure that it is working as expected.
Note: If you want to monitor for only update events, you can choose the “When an item is modified” trigger instead of the “When an item is created, modified or deleted” trigger.