Microsoft Dynamics 365 – Send SMS using Flow

Looking at the list of traditional CRM activities I always miss the SMS, being a common and effective type of communication between organizations and customers.

Sending SMS triggered by Microsoft Dynamics 365 events (e.g. Case created) used to be a developer’s task. You had to write Plugin or Custom Workflow Activity code to access the SMS provider web service and maintain it as endpoints sometime change.

With Flow you can integrate applications in a declarative manner so an event in one application will trigger an action in another application along with custom conditional logic and even wait capabilities (similar to Dynamics 365 internal Workflow Wait step). 

In this post, I’ll walkthrough the process of setting up SMS sending without coding using Flow and Twilio (SMS provider).

  1. Prerequisites

    Before advancing make sure you have the following:

    a. Microsoft Dynamics 365 instance (trial will do)
    b. Twilio account (trial will do – click +sign up in Twilio home page)

  2. Setting up Twilio account

    a. In your Twilio Account console, click ‘Get a number’ button under the build menu

    Setting up Twilio account

    b. In the dialog, choose the suggested number or select a different one.
    c. Go to the Home tab and note the Account SID and Auth Token keys, you will need these later

    Setting up Twilio account

  3. Setting up Flow

    a. Login to your Office 365 environment and click the Flow tile

    Setting up Flow 

    b. In My Flows tab click the ‘+ Create from blank’

    image

    c. In the search box, type in Dynamics and from the results list select the ‘Dynamics 365 – When a record is created’ trigger 

    Setting up Flow

    d. In the Organization Name select the name of your Dynamics 365 instance. In the entity name dropdown select the entity for which the Flow will listen

    Setting up Flow

    e. Click the ‘New Step’ button and then ‘Add an action’

    Setting up Flow

    f. Search and Select the Twilio – Send Text Message (SMS) action

    Setting up Flow

    g. Feed in a name for your Twilio account (for future Flows) and keys from your Twilio Home tab: Account SID goes into the Account ID box, Auth token goes to the Access Token box

    Setting up Flow

    h. Feed in the your Twilio assigned Phone number in the From Phone Number box. Feed the target phone number in the To phone number. Feed in the SMS text. Note you can map dynamic data from the Case record into the text or target phone number

    Setting up Flow

    i. Click ‘Create Flow’ and then ‘Done’ 
     

  4. Testing & Monitoring
    a. In your Dynamics 365 create a new Case.
    b. After a few seconds, you should get a SMS message

    After a few seconds, you should get a SMS message

    c. In Flow management console Click ‘Manage’
    Testing & Monitoring 

    d. You can view your Flow, edit and deactivate it here. Clicking the i will show you the Flow instances details and running results 
     
    Testing & Monitoring

 

Implementation Notes

  1. It may take Flow some time to kick in. If you didn’t get an SMS message after creating the first Case, create another
  2. Twilio trial account will grant you a limited amount of SMS messages and each message will starts with ‘Sent from a Twilio Trial account’
  3. Twilio supports sending messages in these countries
Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s