Remote Event Receiver for SharePoint Online

SharePoint remote event receiver is a SharePoint Online feature which will be triggered on corresponding event took place in SharePoint Online site.

It has the following event types.

  • List Events
  • List Item Event

If the same set of actions are to be performed for multiple sites/lists, a separate flow needs to be created for each site/list. To overcome this limitation, azure function can be registered as event receiver for multiple site collections and lists.

App registration in SharePoint

In SharePoint sitecollection, go to “/_layouts/15/appregnew.aspx” page in your sitecollection to register a new app.

Create azure function

In azure portal (portal.azure.com), create a new function app. Provide the function app name, Resource group and select runtime stack as .Net to use .Net for implementing the logic.

In the function app, create a new function with Http Trigger as the template.

Write the .Net code logic into the function and save it.

Copy the function url and use that to attach the function as event receiver.

Registering Azure Function as Event Receiver

Add-PnPEventReceiver -List <ListName> -Name <FunctionName> -Url <FunctionUrl> -EventReceiverType <EventType> -Synchronization Asynchronous

The Event Type can be

  • ItemAdding
  • ItemAdded
  • ItemUpdating
  • ItemUpdated
  • ItemDeleting
  • ItemDeleted

Now based on the Event Receiver Type specified, the function will be triggered automatically when that particular event happens in the attached SharePoint List or Document Library.

Related Blogs

Elevate ASP.NET Core Web API speed with caching. Explore in-memory, distributed, and