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 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.
Prices for SMS sending and the other services are available for each country.
Send a Text Message to a Phone Number from Dynamics 365
Following environments and steps needed for sending the text message.
- Nexmo for sending text messages using a career/service provider.
- Dynamics 365 trial instance, and schema for storing text message data.
- Microsoft Flow to connect both Dynamics 365 and Nexmo and design the data flow.
- 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.
 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.
 Get a Dynamics 365 instance and create the schema for storing text messages.
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.
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.
“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”,
“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.
 Setup the Microsoft Flow
Microsoft Flow needs two connectors, Dynamics 365 and Nexmo available in Microsoft Flow.
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.
Create the Nexmo connector with API Key and the API Secret shown in the Nexmo account.
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”.
 Create a text message and receive the message in the recipient’s phone
Following message is created in Dynamics 365.
The text message is received to the given phone number as follows.
Microsoft Flow shows the Run History.
There are some other Microsoft Flow Supported services such as Twilio, Plivo etc… available.
Happy Texting from CRM!