· 5 min · TextMeFlow Team

Send WhatsApp Messages from Dynamics 365 via Power Automate

Microsoft Dynamics 365 runs the entire customer relationship for a lot of companies: leads, quotes, opportunities and service appointments all live in one system. What's missing by default is a direct line to the customer's phone. A won deal or a booked appointment generates an internal notification or an email, but no WhatsApp message — even though that's exactly the channel customers actually respond to. With Power Automate and the TextMeFlow API you can build that connection without writing a single line of code inside Dynamics itself.

This article walks through the setup for two concrete triggers: a won opportunity and a new service case. The same pattern works for quotes, invoice reminders or appointment confirmations.

Why Power Automate instead of a Dynamics plugin

Dynamics 365 has its own workflows and Business Process Flows, but those are built to modify records inside Microsoft 365 — not to send a formatted HTTP request to an external API. You could build that yourself with a C# plugin, but that means development work, a build pipeline, and maintenance with every update. Power Automate has an official Dataverse connector with ready-made triggers ("When a row is added, modified or deleted") that connects directly to your Dynamics environment with no extra infrastructure. You just map the fields to the WhatsApp action.

Step 1: pick the trigger in Dataverse

In Power Automate, create a new automated cloud flow with Microsoft Dataverse as the connector and the trigger "When a row is added, modified or deleted". Set:

  • Table name: Opportunities (for a won deal) or Cases (for a new service ticket).
  • Scope: Organization, so the flow fires for every user.
  • Filtering attributes: limit it to the field that determines status (for example statuscode), so the flow doesn't fire on every unrelated change to the record.

Right after that, add a Condition that checks whether the new value matches the status you want to catch, such as "Won" for an opportunity or "New" for a case. Without that check, the flow also runs on intermediate updates that have nothing to do with the status transition.

Step 2: add the WhatsApp action

Add an HTTP action that posts to the TextMeFlow API:

POST https://api.textmeflow.eu/v1/messages
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "to": "@{triggerOutputs()?['body/phonenumber']}",
  "text": "Hi @{triggerOutputs()?['body/contactname']}, good news: your quote has been confirmed. We'll be in touch shortly to finalize the details."
}

Use Power Automate's dynamic content picker to drop the fields from the Dataverse trigger (phone number, contact name, deal value, case number) into the body builder rather than typing the expressions by hand. The full API spec, including response codes and the optional media_url field for attaching a PDF quote, is in /en/docs/api.

Step 3: normalize phone numbers

Dynamics usually stores phone numbers however a staff member typed them: 0470 12 34 56, +32 470 12 34 56, or without a country code at all. The TextMeFlow API expects E.164 format (+ followed by country code and number, with no spaces or parentheses). Between the trigger and the HTTP action, add a Compose action with an expression that:

  • strips spaces, dots and parentheses with replace();
  • replaces a leading 0 with +32 (or your own country code) using a conditional expression.

Messages with a number that still doesn't validate after normalization get rejected by the API with an error code. Catch that with a Configure run after setting on a follow-up step, so a failed send triggers an internal Teams or email alert instead of silently disappearing.

Step 4: write the delivery status back

Once the message is delivered or read, TextMeFlow sends a signed webhook event to an endpoint you control — see /en/docs/webhooks for the full event list and HMAC verification. Set up a second flow with the trigger "When an HTTP request is received", verify the signature, and use the Dataverse action "Update a row" to update a field on the opportunity or case (for example a custom whatsapp_status field). That way you can see right inside Dynamics whether a customer actually received the message, without opening a separate dashboard.

Step 5: avoid duplicate messages

A status field that flips back and forth — an opportunity that moves between "Open" and "Won" because of a correction, say — can trigger the flow repeatedly. Limit the condition to the exact transition you mean, and add a check inside the flow that reads an existing whatsapp_status field before sending: if it's already set to "sent," stop the flow.

These messages are transactional and one-to-one — an order confirmation, a case notification. This pattern isn't meant for bulk sends to a full customer list; that belongs on a separate opt-in flow and falls under the anti-spam pipeline's risk score, see /en/docs/anti-spam.

What you get

A won deal that triggers an instant confirmation, a service case that sends an acknowledgment within seconds, a status update that writes itself back into Dynamics — all without a salesperson or support agent drafting the message by hand. Every message runs through the same pipeline as any other TextMeFlow integration: rate limiting, risk scoring, automatic STOP handling and quiet hours, so there's nothing extra to configure yourself.

Start with one trigger — "Opportunity Won," for example — and expand to cases or quotes once that's running reliably. Start free on TextMeFlow: 50 messages a month, forever, enough to build and test the full Dynamics 365 integration before you move to a paid plan.

Want to send WhatsApp messages via API yourself?

Free forever up to 50 messages/month. Scan a QR and send your first message within 5 minutes.

Free forever