SMS Integration with Dynamics 365 + Microsoft Flow + Nexmo

Microsoft Power Platform brings a great set of tools to customize, extend capabilities of most of the favorite apps and create new apps online. Power BI, Power Apps, and Flow are the three pillars of Power Platform.

Microsoft Flow https://flow.microsoft.com

In the modern world, so many applications from different technologies exist and integrating them was a challenge and now Microsoft Flow can be used to create workflows between different apps.

Nexmo https://www.nexmo.com

Nexmo provides various cloud-based APIs such as SMS, Voice, User Authentication, User Identity APIs. Nexmo says SMS API allows you to send and receive text messages to users around the globe through simple RESTful APIs and having following features.

  • Programmatically send and receive a high volume of SMS anywhere in the world.
  • Build apps that scale with the web technologies that you are already using.
  • Send SMS with low latency and high delivery rates.
  • Receive SMS for free using SMS-enabled local numbers in countries around the world.
  • Only pay for the usage.

Most importantly Nexmo provides a connection in Microsoft Flow which makes most of the integration processes easier. Various actions of Nexmo can be triggered through Microsoft Flow.

Nexmo trial account can be created using a valid phone number.

Pricing

Prices for SMS sending and the other services are available for each country.

SmsPricing

Send a Text Message to a Phone Number from Dynamics 365

Following environments and steps needed for sending the text message.

  1. Nexmo for sending text messages using a career/service provider.
  2. Dynamics 365 trial instance, and schema for storing text message data.
  3. Microsoft Flow to connect both Dynamics 365 and Nexmo and design the data flow.
  4. Create the text message in Dynamics 365 and receive the message in the recipient’s phone.

When you get a Dynamics 365 instances, you can use the same credentials to log in to Microsoft Flow as well.

[1] Create a Nexmo account

Nexmo needs an account and it’s very straightforward with a valid phone number. Nexmo account gives API Key and the API Secret which can be used in integration to SMS sending.

27

[2] Get a Dynamics 365 instance and create the schema for storing text messages.

21

Creating an entity for storing all the text messages is not mandatory but having a separate entity will be useful in many different ways. Also, I am thinking that the entity is another activity type. The idea is to reuse activity fields and to trigger the Flow when creating the text message record in Dynamics 365.

22

Enabling “Change Tracking” is important when Dynamics 365 data are dealt with external systems. By selecting, or deselecting, change tracking for specific entities the load on the server resources can be reduced and save processing time when extracting Dynamics 365 data and synchronizing it to an external store.

The following error will be thrown in Microsoft Flow when Change Tracking checkbox is clear and trying to send text messages.

{
“status”412,
“message”“Entity: cf_textmessage isn’t enabled for change tracking. Please take a look at the link for more details: https://technet.microsoft.com/library/3fa9c316-9dc9-4b28-9abf-43a3fce5b01d.aspx”,
“source”“crmfortress.crm6.dynamics.com”,
“errors”: [],
“debugInfo”“clientRequestId: 5d1c1111-72ce-45da-afdf-9a6199710f81″
}

Text Message looks as follows.

The recipient is the field to store the recipient phone number.

Description field contains the text message.

29

 

[3] Setup the Microsoft Flow

Microsoft Flow needs two connectors, Dynamics 365 and Nexmo available in Microsoft Flow.

24

Following Dynamics 365 connector(or “When a record is created” connector) can be used to connect and trigger Microsoft Flow when Text Message is created.

26

 

Create the Nexmo connector with API Key and the API Secret shown in the Nexmo account.25.PNG

Flow looks as follows. To Phone number and the Text have been mapped to Text Message entity fields. Sender Id can be used to show in the recipient’s phone. Nexmo connector here is “Send an SMS”.

23

 

[4] Create a text message and receive the message in the recipient’s phone

Following message is created in Dynamics 365.

28

The text message is received to the given phone number as follows.

Screenshot_20181107-002005

 

Microsoft Flow shows the Run History.

30.PNG

There are some other Microsoft Flow Supported services such as Twilio, Plivo etc… available.

Happy Texting from CRM!

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s