Microsoft Dynamics 365 Sales

Microsoft Dynamics 365 Sales is an enterprise CRM solution that manages customer relationships through contacts, leads, opportunities, and activities. This integration utilizes Power Automate to automatically push real-time sales data from Microsoft Dynamics 365 (D365) Sales to the MoEngage platform.

This automatic data synchronization helps marketing and support teams to trigger highly contextual and personalized engagement campaigns based on sales activities and the customer lifecycle.

MoEngage <> Microsoft Dynamics 365

The integration of D365 Sales and MoEngage enables enhanced alignment between marketing and sales. With this integration, you can:

  • Synchronize Contacts, Leads, and Opportunities from D365 Sales to MoEngage.
  • Import sales activities like Calls, Meetings, and Tasks as behavioral events.
  • Capture custom attributes and relationships for comprehensive customer profiling.
  • Trigger contextual campaigns based on sales interactions and opportunity lifecycle events.

Use Cases

Integrating Microsoft Dynamics 365 with MoEngage helps you solve the following use case:

  • Lead-to-engagement: When a new Lead is created in D365, the complete lead data is automatically pushed to MoEngage, allowing you to instantly trigger a personalized welcome campaign and enroll the lead in relevant nurturing sequences based on their source or score.
  • Contact synchronization: When Opportunity stages change (for example, from Qualify to Propose ), push updates to MoEngage to send targeted content, deal status notifications, or win/loss analysis.
  • Sales activity events: When Calls, Meetings, or Tasks are logged, capture these as behavioral events in MoEngage for engagement attribution.
  • CSAT (Customer Satisfaction Score) and re-engagement: When Opportunities are closed or deals are won, trigger satisfaction surveys or customer onboarding campaigns.

Sync Modules

The following table outlines the data synchronization type for each D365 Sales module:

Module MoEngage Sync Type
Contacts
Users
Leads
Users
Opportunities Events
Tasks
Events 
Calls Events 
Meetings Events 
Custom Entities Events (Custom)

Integration

library_add_check

Prerequisites

Admin access to your Power Automate and D365 Sales environment.

Step 1: Get Your MoEngage Endpoint

To get a dedicated endpoint for your integration, please contact the MoEngage Support team. In your request, you must specify the common identifier used to link user profiles between MoEngage and the partner platform.

Step 2: Create a Power Automate Flow

To create a Power Automate flow, perform the following steps:

  1. Open Power Automate.
  2. Click Create > Automated Cloud Flow.
  3. Provide the flow name. For example,D365 - Sync Contact to MoEngage.
  4. Select the trigger When a row is added, modified, or deleted (Dataverse).
  5. Configure the following trigger details:
    1. Table: Click the entity you want to sync (for example, Contact, Lead, Opportunity).
    2. Scope: Click Organization.
    3. Trigger on: Click Added or Modified.

Step 3: Configure HTTP Webhook Action

To configure the HTTP Webhook action, perform the following steps:

  1. Click New Step > HTTP.
  2. Provide the following details:
    HTTP Webhook Section Description
    Method POST
    URL

    Enter the dedicated Webhook URL provided by MoEngage in the following format:
    https://api-0X.moengage.com/v1/partner/d365-sales/{events/users}/?configName={config_name}.

    Custom Headers
    Header(s) Value
    Content-Type application/json
    Authorization

    To authenticate your request, use the following format for the Authorization header: Basic [Base64(Workspace_ID:API_Key)]"

    Generate a Basic Authentication Token using an online Basic Auth Header Generator tool. You must enter your Workspace ID as username and Data API Key as password. To find your credentials, perform the following steps:

    1. On the MoEngage UI, navigate to Settings > Account > APIs.
    2. Copy the ID under Workspace ID (earlier app id).
    3. Copy the Data under API keys.

    Your Basic Authentication Token is a combination of Workspace ID and Data. For example, paste the following value as your Basic Authentication Token: Basic {base64_encoded_credentials}

    Note: Ensure the token is copied completely without extra spaces.

    Body

    For the Body content, use one of the sample payloads provided in the examples.

Step 4: Add Request Body Payload

To add the request body payload, perform the following steps:

  1. Copy the appropriate payload template below and paste it into the Body field of the HTTP action.
  2. Replace placeholder values (for example, @{'triggerBody()?['firstname']}) with the corresponding Dynamic content fields from the D365 trigger.

Contacts & Leads (User Sync)

JSON
{
  "customer_id": "@{triggerBody()?['contactid']}",
  "u_fn": "@{triggerBody()?['firstname']}",
  "u_ln": "@{triggerBody()?['lastname']}",
  "u_em": "@{triggerBody()?['emailaddress1']}",
  "u_mb": "@{triggerBody()?['mobilephone']}",
  "updated_at": "@{triggerBody()?['modifiedon']}",
  "user_attributes": {
    "job_title": "@{triggerBody()?['jobtitle']}",
    "company_name": "@{triggerBody()?['companyname']}",
    "account_id": "@{triggerBody()?['_accountid_value']}",
    "business_phone": "@{triggerBody()?['telephone1']}",
    "status": "@{triggerBody()?['statecode']}"
  }
}

 

info

Information

Add additional custom fields to user_attributes.

Opportunities (Event)

JSON
{
  "customer_id": "@{triggerBody()?['opportunityid']}",
  "u_fn": "@{triggerBody()?['name']}",
  "u_ln": "",
  "u_em": "",
  "u_mb": "",
  "updated_at": "@{triggerBody()?['modifiedon']}",
  "event_attributes": {
    "event_name": "opportunity_updated",
    "opportunity_id": "@{triggerBody()?['opportunityid']}",
    "opportunity_name": "@{triggerBody()?['name']}",
    "deal_value": "@{triggerBody()?['estimatedvalue']}",
    "stage": "@{triggerBody()?['stageid']}",
    "probability": "@{triggerBody()?['closeprobability']}",
    "close_date": "@{triggerBody()?['estimatedclosedate']}",
    "owner_id": "@{triggerBody()?['_ownerid_value']}"
  }
}

Tasks, Calls & Meetings (Activity Events)

JSON
{
  "customer_id": "@{triggerBody()?['regardingobjectid']}",
  "u_fn": "@{triggerBody()?['subject']}",
  "u_ln": "",
  "u_em": "",
  "u_mb": "@{triggerBody()?['phonenumber']}",
  "updated_at": "@{triggerBody()?['modifiedon']}",
  "event_attributes": {
    "event_name": "task_created",
    "activity_id": "@{triggerBody()?['taskid']}",
    "subject": "@{triggerBody()?['subject']}",
    "priority": "@{triggerBody()?['prioritycode']}",
    "due_date": "@{triggerBody()?['duedate']}",
    "status": "@{triggerBody()?['statecode']}",
    "owner_id": "@{triggerBody()?['_ownerid_value']}"
  }
}

 

info

Information

  • For each activity type, set the event_name to {{activity name}}, or a custom value.
  • Add additional custom event fields toevent_attributes.

Required Fields

Field (Key) Required
customer_id Yes
u_fn Yes
u_ln Yes
u_em Yes
u_mb Yes
updated_at Yes
user_attributes No
event_name Yes (events)
event_attributes Yes (events)

Data Mapping Guidelines

  • Unique Identifier (Customer ID): Use a consistent, immutable identifier to link user profiles between D365 and MoEngage. Map this value to the customer_id field in your MoEngage payload. This is critical for data merging and preventing duplicate user profiles:
    • Email address (if unique)
    • D365 record GUID (for example, contactid, leadid)
    • External ID (if configured in D365)
  • Event Name (event_name): Always include a descriptive event_name to identify and categorize actions in MoEngage. This ensures all events are tracked accurately for analysis and segmentation.

Step 5: Test the Integration

To test the integration, perform the following steps:

  1. In Power Automate, click Test and then manually trigger a cloud flow.
  2. Create or update a test record in D365 Sales (for example, create a new Contact ).
  3. Monitor the flow execution in Power Automate for a successful HTTP 200/201 response.
  4. Verify in MoEngage UI to confirm the test data has synced correctly within 1–5 minutes.

Previous

Next

Was this article helpful?
0 out of 0 found this helpful

How can we improve this article?