web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

Sending Survey Invitations Via SMS (Text)

Megan V. Walker Profile Picture Megan V. Walker 1,810 Most Valuable Professional

Using an SMS (text message) option as a form of communication can be extremely beneficial to your organsation. It gives the ability to keep in touch with your customers in ways that suit them. We’ve looked at ways to send out Forms Pro Surveys using email, but how could we send a link to a survey invite via SMS? It’s not the only option, but there is a Microsoft Flow connector for a company names Twilio. It’s a quick and easy product to use, and cost wise not too expensive. The fact that you can use it in a Flow, and combine with Forms Pro…. that’s awesome! So let’s get to our scenario.

In this example, we want to ask for feedback about an event from each Contact that attended and has been added to a Marketing List in Dynamics 365 Customer Engagement. Our survey has a custom piped variable called Event, and we are also going to use the standard First Name variable. These have been added to the survey and will be pulled in for each person receiving the request to complete the survey.

Before building the Flow, sign up for Twilio. NOTE: this is in NO WAY a sponsored post, I am not getting anything from Twilio for this, just a cool thing you can do in relation to Forms Pro! Once you have got your account set up, navigate to the Dashboard. You will need your Account SID and Auth Token shortly.

Now let’s look at the Flow. First we need our trigger. This will be from the CDS Connector – ‘When a record is selected’. This will allow us to create an option to run the Flow from a record in CDS. Select the Marketing Lists entity. Our next step is the Get record action. Select the Marketing Lists entity again and then use the Item Identifier of List from the trigger step. We then need to get the List Members by using the list records action, and using the Odata query of _listid_value eq and then the List id from the Get record step.

Now we add a Get record step and get the Contact (or Lead depending on your Marketing List) and use the Entity from the previous step as the Item identifier. Next we add a condition to check to see if the Contact has a mobile phone. You can use this as your query string:

@not(empty(body('Get_matching_Contact')?['mobilephone']))

We do nothing if there isn’t a mobile phone on the record, but if there is we need to use the Create an invitation action from the Forms Pro connector. Select the Survey, then fill out all of the values like you see below. For the Event, we are using the Name of the Marketing List from the original trigger step.

We could go on to the Twilio connector next and add the link we just created directly in to the text message. However, the URL created from the invitation is too long… and although the person receiveing the text will be able to open the survey, the piped variables including their first name and the event name will not be passed through. They will just get {First Name} and {Event} rather than the actual values. So we need to use the Bitly connector and add the Invitation link value in to the URL.

Now we add the Twilio connector. Give the connection a name, then add your Account ID and Access Token.

The From Phone number will be the one set up on the Twilio account. For the To Phone Number use the Mobile Phone from the Get Matching Contact step. You can then use a few sentences, but pull in the First Name and the name of the Marketing List. Finally, make sure you include the shortened link from the Bitly step.

Now from the Marketing List, we can click on Flow and select the Send SMS Survey option.

The Flow will run, and the text message is received with the piped variables of First Name and Marketing List Name.

Clicking on the link then opens the survey on the recipients phone with the correct piped variables.

Want to just watch how to do this? Check out the video below:


This was originally posted here.

Comments

*This post is locked for comments