Categories: Power Automate

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:


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:

Check out the latest post:
Predefined Placeholder Access In Customer Insights - Journeys

This is just 1 of 456 articles. You can browse through all of them by going to the main blog page, or navigate through different categories to find more content you are interested in. You can also subscribe and get new blog posts emailed to you directly.

14 thoughts on “Sending Survey Invitations Via SMS (Text)

  1. I think the Twilio connector will only send messages to a phone number that has been verified as willing to accept messages. This might be a reason why, if people try this, the messages don’t get through to their recipients. It’s certainly the case in the UK anyway.

    1. Hi Matt, thanks for the comment! Trial accounts won’t let you send to unverified numbers that’s for sure. I’ve paid for an account in order to do a demo for a global audience and the texts will go out to all numbers regardless of being verified or not. In a real world business scenario you would want to have some kind of opt in process before sending the texts.

  2. Awsome post Megan!
    This is something I would like to try, but I might have to get some acceptance to sending them out:) Alternatively I could use this approach to get them to update the subscription preferences also 😉

    People read SMS, so this is very valuable!:)

    1. Hi Thomas! Thanks for the comment, and reading my post 🙂 – Yes, I would suggest some kind of opt in process for sure. I have a post out tomorrow that talks about unsubscribes and how to handle them, and in it I suggest adding a new field ‘Survey Invites’ which is similar to the other communication ones, so the field would be two options, Allow/Do Not Allow. You can then decide what is the right approach for your requirements and determine how to ‘opt in’ people to texts.

  3. Hi Megan,

    Thanks for the post. I was able to create something similar for another use case I was working on. However the ‘create an invitation’ action step still has a dependency on email. Have you experienced the same from your end? Did you end up finding a workaround?

    Thank you.

    1. Hi Rafael, I have submitted a request to Microsoft to find out more (which I did originally last month when you asked). I haven’t heard back so just followed up with them again.

    2. Great, thanks for getting back to me Megan. I will most probably send a request myselft to Microsoft as well.

    3. I have confirmation that they’ve submitted it as a bug and will work on fixing it. Right now there is no date as to when that will be completed.

    4. Hi Rafael, it seems like this will be resolved in a release in October.

  4. Hi Megan,
    Thanks for the post. It was very informative.

    The issue in getting the Survey Link from Send Survey option in Microsoft Flow:

    I wanted to send SMS and Email to the customer to get the Survey response. Email functionality works fine and I am able to get the response. But when I try to send the Survey link through SMS I don’t get the survey link from the “Send Survey” action as a response.

    Is there a way to get the Survey Link from “Send Survey” action?

    (create invitation action gives me the invitation link that I wanted but “when the response submitted ” action is not working at the same time. Because once the response is submitted “when the response submitted ” action is not running)

    1. You can only get the invitation link from the create invitation link at least from what I am aware. You could try the send survey action, then do a get record action to get the survey invitation related to that and see if the link is in there. I haven’t tried it. Let me know what you find!

    2. Thanks for the reply.
      I tried adding “Get Record” action but I don’t have Survey Unique ID to pass it to “Get Record” action to get the Survey Invite entity record.
      (“Send Survey” action always returns nothing).

Comments are closed for this post.