Eventbrite and Dynamics 365 integration using Microsoft Flow


There’s quite a few integration services around that will sync Eventbrite data into your Dynamics 365 organisation and I’ve found that they can be quite expensive. A recent project called for us to get a little creative and find a cheaper alternative – that’s where Microsoft Flow comes in!

What can it do?

Using Microsoft Flow we can achieve the following:

  • Sync new Eventbrite events into Dynamics 365
  • Sync new Eventbrite registrations into Dynamics 365
  • Sync Eventbrite registration updates into Dynamics 365
      • I.e. Cancellations, email or name changes

One limitation it has at the moment is that updates to events are not picked up as there’s no trigger in Microsoft Flow for this action. It’s a small price to pay when comparing the costs to the other integration options. Microsoft are always adding new features and connections to Flow each month, so who knows it may be available soon. I get around this by displaying the actual Eventbrite event in an iFrame on the form.

The only other drawback is that a new Flow needs to be configured for each new event so that registrations are captured in Dynamics 365. This is an easy process, as it’s done by cloning an existing Flow and tweaking it to point to the new event. So all in all, it adds maybe 5 minutes to the event creating process.

Microsoft Flow Licensing

Since Eventbrite is a premium Microsoft Flow connection, a Premium license is required to setup this integration. The great thing is if you already have a Dynamics 365 Enterprise license (including Sales or Service Enterprise), then Microsoft Flow Premium is already included – so no need for an extra license!

Summary

At a high-level I’ll step you through the following changes to get the integration between Eventbrite and Dynamics 365 working:

  1. Create the event and event registration entities in Dynamics 365
  2. Create a Dynamics plugin to create / update a Dynamics 365 lead or contact based on new event registrations
  3. Create 2 Microsoft Flows to manage syncing Eventbrite event and registration data

Dynamics 365 Structure

Create the following 2 new entities within Dynamics 365 to represent the event and the event registration:

Event:

Name: Event

Schema Name: new_event

Attributes:

Column NameSchema NameTypeSize
Namenew_nameSingle line of text512
Start Datenew_startdateDate and Time
End Datenew_enddateDate and Time
Eventbrite URLnew_eventbriteurlSingle line of text512
Descriptionnew_descriptionMultiple lines of text2000
Eventbrite IDnew_eventbriteidSingle line of text50

Event Registration:

Name: Event Registration

Schema Name: new_eventregistration

Attributes:

Column NameSchema NameTypeSize
First Namenew_firstnameSingle line of text100
Last Namenew_lastnameSingle line of text150
Emailnew_emailSingle line of text300
Registration Statusnew_registrationstatusOptionset:
- Registered (default)
- Attended
- Cancelled
EventBrite Statusnew_eventbritestatusSingle line of text20
Eventbrite IDnew_eventbriteidSingle line of text20

Note: all but the Eventbrite Status field are shown on the form. The Eventbrite Status is used behind the scenes by the plugin to translate the passed Eventbrite status to the Registration Status optionset. Eventbrite will pass either of the following values:

  • placed = Registered
  • refunded = Cancelled

Relationships:

Add 3 new many to one (N:1) relationships:

  1. Event:

Lookup field display name: Event

Lookup field name: new_eventid

  1. Lead:

Lookup field display name: Lead

Lookup field name: new_leadid

  1. Contact:

Lookup field display name: Contact

Lookup field name: new_contactid

Dynamics 365 Plugin

The primary use of the plugin is to search Dynamics 365 using the registration email address for a lead or contact. If a record is found, then it attaches the registration to it, otherwise it will create a new lead record and attach the registration to it.

This could have been achieved within Microsoft Flow by adding “Dynamics 365 list records” step, however I prefer the flexibility of a plugin. It allows me to add extra search or create record logic that would be above and beyond MS Flow’s capabilities.

Plugin Code

Use the following code to create the new plugin (feel free to tweak the logic as needed).

Register Plugin

Register the plugin and setup the following steps:

Step 1

Message: Create

Primary Entity: new_eventregistration

Execution Stage: PreOperation

Step 2

Message: Update

Primary Entity: new_eventregistration

Filtering Attributes: new_email, new_eventbritestatus

Execution Stage: PreOperation

Image:

Create a new Pre Image against this step named PreImage with the following parameters:

  • new_firstname
  • new_lastname

Microsoft Flow

Now that the required components are setup within Dynamics 365 it’s time to setup a new Microsoft Flow to integration Event information from Eventbrite into Dynamics 365.

There’s at least 2 Flows that need to be configured:

1. Create an Event in Dynamics 365 when a new Event is created in Eventbrite

This first flow will integrate event data into Dynamics 365:

  1. Log into Microsoft Flow: https://flow.microsoft.com/en-us/
  2. Select My Flows in the toolbar
  3. Select + Create from blank
  4. Select the “Search hundreds of connectors and triggers” box and search for Eventbrite
  5. Select the Eventbrite – When an event is created trigger
  6. It will prompt to create a connection to Eventbrite, click Sign in

Microsoft Flow create eventbrite connection

  1. A new window will open, enter your Eventbrite login Email address and click Get Started
  2. Enter your Eventbrite password and click Log in
  3. Click Allow  to give Microsoft Flow access to Eventbrite data

Microsoft Flow create Eventbrite allow connection

  1. Now the connection is configured, back in the new Flow select the Eventbrite Organizer from the drop down.
  2. Select + New step and Add an action

  1. In the search box type “Dynamics 365″ and select Dynamics 365 – Create a new record

Microsoft Flow eventbrite event to dynamics step 2

  1. If your current Flow user account has a Dynamics user license, it will log into Dynamics 365 automatically. If not, click Connect and set up the connection.
  2. Select the Dynamics 365 Organization Name and Events from within the Entity Name drop down

Microsoft Flow eventbrite event to dynamics step 3

  1. Click Show advanced options  to view all available fields to map
  2. Map the following fields by placing the cursor into the field within the Create a new record task and selecting it from the Eventbrite mapping:
  • Name = Name
  • Description = Description
  • End Date = End UTC
  • Eventbrite ID = Id
  • Eventbrite URL = URL
  • Start Date = Start UTC

The mapping should look like the screenshot below:

Microsoft Flow eventbrite event to dynamics step 4

Note: I recommend using the UTC date fields, that way the correct date and time is recorded in Dynamics 365.

  1. Update the name of the flow to something more meaningful by selecting the title of the Flow in the top left just under the toolbar. I’m changing mine to When an Eventbrite event is created -> Create a new Dynamics 365 Event
  2. Click Save

Test the Flow

Now you have created the flow, head over to Eventbrite and create a new Event. Once that’s done, head back into Microsoft Flow, select the newly created Flow and look at the run history below – if all went well you should see a step with a status of Succeeded:

Microsoft Flow Run History

Note: this can take up to 10 minutes.

Once it’s succeeded, check in Dynamics 365 and you should have your first newly created Event.

2. Create or Update an Event Registration in Dynamics 365 when an Eventbrite registration is created or updated

This is the flow we need to create specifically for each event in Eventbrite. As I previously mentioned, once it’s in place, it’s easy to clone and point it to a new Eventbrite event.

Please ensure there’s an Event already in place within Eventbrite before proceeding with this step.

  1. Log into Microsoft Flow: https://flow.microsoft.com/en-us/
  2. Select My Flows in the toolbar
  3. Select + Create from blank
  4. Select the “Search hundreds of connectors and triggers” box and search for Eventbrite
  5. Select the Eventbrite – When an order changes trigger
  6. In the Event drop down select the event the Flow will monitor. In my case below, I’ll use my event called “Test Event”

Microsoft Flow eventbrite event registration to dynamics step 1

  1. Click + New step and Add an action

Microsoft Flow eventbrite event registration to dynamics step 2

  1. In the search box type “Dynamics 365″ and select Dynamics 365 – Get record

Microsoft Flow eventbrite event registration to dynamics step 3

  1. Select the Organisation Name and the Entity Name of Events and enter the ID of the event created in the previous Flow.

This step gets the event record from Dynamics 365, which will be used later in the flow.

To get the ID, open the event within Dynamics 365 and click the Email a link  tool bar button and grab the id from ti URL.

Here’s what it should look like so far:

Microsoft Flow eventbrite event registration to dynamics step 4

The next step is to check to see if the registration already exists in Dynamics 365 using the Eventbrite registration ID:

  1. Select + New step and Add an action
  2. In the search box type “Dynamics 365″ and select Dynamics 365 – List records
  3. Select the Organisation Name and set the Entity Name of Event Registrations. 
  4. Click Show advanced options
  5. Enter the following:
  • Filter Query = new_eventbriteid = ‘<Eventbrite ID from Dynamic content>’
  • Top Count = 1

Note: to get <Eventbrite ID from Dynamic content> scroll down towards the bottom of the dynamic content window.

Microsoft Flow eventbrite event registration to dynamics step 5

The next step is to check to see if any results were returned from the List records query by using a Condition

  1. Select + New step and Add a condition
  2. Click Edit in advanced mode
  3. Paste the following into the condition:

@empty(body(‘List_records’)?[‘value’])

Microsoft Flow eventbrite event registration to dynamics step 6

This condition checks to see if the results are empty, if it’s true (Yes), then we will create a new Event Registration record, otherwise if a record is found (No), we will update the existing record:

  1. In the green Yes  box click Add an action
  2. In the search box type “Dynamics 365″ and select Dynamics 365 – Create a new record
  3. Select the Organisation Name and the Entity Name of Event Registrations. 
  4. Select Show advanced options and use the following mapping from the Eventbrite fields:
  • Name = Name
  • Email = Email
  • Event = Event (from the Get record task)
  • Eventbrite ID = Id
  • Eventbrite Status = Status
  • First Name = First Name
  • Last Name = Last Name

The mapping should look like this:

Microsoft Flow eventbrite event registration to dynamics step 7

  1. In the red No  box click …More and select Add an apply to each

Microsoft Flow eventbrite event registration to dynamics step 8

  1. Within the Select an output from previous steps text box select value from the List records  task.

Microsoft Flow eventbrite event registration to dynamics step 9

  1. Within the Apply to each  task click + Add action
  2. In the search box type “Dynamics 365″ and select Dynamics 365 – Update a record
  3. Select the Organisation Name and the Entity Name of Event Registrations. 
  4. Set the Record Identifier  to Event Registration (from List Records)
  5. Select Show advanced options and use the following mapping from the Eventbrite fields:
  • Name = Name
  • Email = Email
  • Eventbrite Status = Status
  • First Name = First Name
  • Last Name = Last Name

The mapping should look like this:

Microsoft Flow eventbrite event registration to dynamics step 10

  1. Now to give the flow a meaningful name, remember that this flow is specific for the event named “Test”, so I’ll name it “Test Event Registrations” by clicking the Flow name in the top left (next to the arrow):

Microsoft Flow eventbrite event registration name the flow

And you’re done! The overall flow should look like this:

Microsoft Flow eventbrite event registration entire Flow

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Posts