Microsoft Dynamics 365 (Dataverse Leads): Send Chat Leads to Dynamics with Power Automate

Already using Microsoft Dynamics 365 Sales? This guide shows how to push qualified leads and full chat transcripts from Social Intents into your existing Dataverse Leads table via Power Automate. No custom OAuth handling, your Flow uses your organization’s secure, first-party connector.

Dynamics 365 Leads integration with Social Intents

What This Dynamics 365 Integration Does

Your AI chatbot or live chat collects name, email, phone, company, page URL, and the full transcript. Social Intents then posts that data to a secure Power Automate HTTP endpoint. The Flow uses Microsoft Dataverse to Add a new row in Leads, and can also attach the transcript as a Note (annotation). Result: consistent lead capture in Dynamics 365 with conversation context.

Assumptions (For Existing Dynamics 365 Customers)

  • You have an active Dynamics 365 Sales environment with Dataverse available.
  • You can access Power Automate in the same tenant and environment.
  • Your connection user has rights to create Leads and Notes if used.

Fields You’ll Send From Social Intents

Standard: email, first name, last name, phone, company, website or page URL
Context: transcript and sessionId

Step 1 Create a Custom Action in Social Intents

In Social Intents, create a new Custom Action → Call API Request. Name it create_dynamics_lead or similar. Set it to Auto Trigger on Chat End or trigger via your qualification rules.

Request Settings

  • Method: POST
  • Headers:
    • Content-Type: application/json
    • x-webhook-secret: YOUR_LONG_RANDOM_SECRET
  • Body JSON template:
{
  "subject": "Chat lead from {{widgetName}}",
  "firstname": "{{visitorFirstName}}",
  "lastname": "{{visitorLastName}}",
  "company": "{{visitorCompany}}",
  "email": "{{visitorEmail}}",
  "phone": "{{phone}}",
  "website": "{{sourceUrl}}",
  "transcript": "{{transcript}}",
  "sessionId": "{{sessionId}}"
}

Step 2 Build the Power Automate Flow

  1. Create an Instant cloud flow with trigger When an HTTP request is received in your Dynamics Dataverse environment.
  2. Generate the JSON schema from this sample payload:
    {
      "subject": "Chat lead from Widget A",
      "firstname": "Jamie",
      "lastname": "Rivera",
      "company": "Acme Co",
      "email": "jamie@example.com",
      "phone": "+1 404 555 1212",
      "website": "https://example.com/pricing",
      "transcript": "Agent: Hi...\nVisitor: ...",
      "sessionId": "abc123"
    }
  3. Add a shared-secret check:
    • Condition: triggerOutputs()?['headers']?['x-webhook-secret'] is equal to YOUR_LONG_RANDOM_SECRET
    • If no branch: Response 401 with body {"ok":false}
  4. Add a Lead row in the If yes branch:
    • Action: Microsoft Dataverse Add a new row
    • Table: Leads
    • Map fields:
      • Topic ← subject
      • First Name ← firstname
      • Last Name ← lastname
      • Company Name ← company
      • Email ← email
      • Mobile Phone ← phone
      • Website ← website
      • Description ← expression:
        concat(
          'Session: ', triggerBody()?['sessionId'],
          '\n\n--- Transcript ---\n', coalesce(triggerBody()?['transcript'], '')
        )
  5. Optional attach transcript as Note:
    • Action: Microsoft Dataverse Add a new row
    • Table: Notes (annotations)
    • Subject: Chat transcript
    • Note Text: transcript from trigger
    • Regarding (Lead): set to the new Lead Item ID output
  6. Return a Response to Social Intents:
    {
      "ok": true,
      "message": "Lead created",
      "leadId": "@{outputs('Add_a_new_row')?['body/leadid']}"
    }
  7. Save the Flow. Then re-open the trigger card to view the HTTP POST URL field.

The HTTP POST URL is generated by Power Automate when you save the Flow. It looks like:

https://prod-45.westus.logic.azure.com/workflows/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=AbCdEfGhIjKlMnOpQrStUvWxYz

Copy this full URL and paste it into the Endpoint URL of your Social Intents Custom Action. Keep your x-webhook-secret header in sync with the Flow for security.

Example Use Case

Automatically Create a Lead When a Chat Ends

Configure the action to fire on chat completion. Every conversation generates a Lead in Dynamics 365 with the transcript embedded in Description or attached as a Note, giving sales context on first touch.

Troubleshooting in Existing Environments

  • Connector not available: Build the Flow in the same Dataverse environment used by your Dynamics 365 Sales app.
  • Permission errors: The connection user needs create rights on Leads and Notes if applicable.
  • Note lookup fails: Use the Lead step’s Item ID output for Regarding (Lead).
  • Security: Protect the Flow URL, enforce x-webhook-secret, and optionally gate with Azure APIM or conditional access.

With Social Intents, Power Automate, and Microsoft Dataverse, your Dynamics 365 lead capture becomes automatic and secure with no manual entry and no token management.