Twilio Two-Way SMS Feedback Survey
Sends an SMS survey via Twilio after a transaction, receives the customer's reply through a Twilio inbound webhook into an HTTP-triggered flow, scores it, stores the result in Dataverse, and posts low scores to a Teams channel for follow-up. Captures feedback from customers who never open email.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This solution runs a two-way SMS feedback survey on Twilio, fully connector-first. After a transaction, an outbound flow texts the customer a short 1-5 survey; a second, HTTP-triggered flow receives the customer's reply through Twilio's inbound webhook, scores it, records the result in a Dataverse table, and posts low scores to a Teams channel for follow-up.
Why it matters: SMS response rates dwarf email. A two-way text survey captures feedback from customers who never open email, with instant routing of detractors to the team.
Built and verified (Flow Checker 0 errors / 0 warnings on both flows). Both flows ship Off - going live requires only connection authorization, environment-variable configuration, and pointing the Twilio number's inbound webhook at the reply-handler's HTTP trigger URL.
Use Case
A business wants quick post-transaction feedback by text, captured and scored automatically, with unhappy responses surfaced to the team right away. A transaction/order system inserts a survey-request row into the Dataverse SMS Survey table; the outbound flow does the rest.
Flow Architecture
Flow A: When a New Survey Request is Created
Dataverse SubscribeWebhookTrigger (Create, Organization scope)Outbound sender; fires on each new survey-request row
Initialize variables
Initialize Variable x3Correlation id (coalesce row id or guid), Twilio sender, survey message
Send Survey SMS
Twilio SendMessageTexts the customer the 1-5 survey
Mark Survey Sent
Dataverse UpdateRecordSets status Sent, stamps sent date + correlation id
Flow B: When a HTTP request is received
Request (Twilio inbound webhook, form-encoded)Inbound reply handler
Parse + score reply
Initialize VariableLow-score threshold, Teams target, trimmed reply, first token, score (first token if 1-5 else 0)
Find Sent Survey
Dataverse ListRecordsMost recent Sent survey for this phone ($top 1, sent date desc)
Update Survey Response
If + Dataverse UpdateRecordStatus Responded, score, reply text, responded date (only when a survey matches)
Post Low Score Teams
If + Teams PostMessageToConversationPosts a detractor alert when score > 0 and <= threshold
Respond To Twilio (TwiML)
ResponseReturns TwiML so the customer gets an instant thank-you
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_TwilioFromNumber | String | +15551234567 | Verified Twilio sender number |
| flowlibs_SmsSurveyMessage | String | Thanks for your business! Reply with a number 1-5 to rate your experience. | Outbound survey text |
| flowlibs_SmsSurveyLowScoreThreshold | String | 3 | Replies at/below this score route to Teams |
| flowlibs_TeamsGroupId | String | <your-team-id> | Teams team/group id for the detractor alert |
| flowlibs_TeamsChannelId | String | <your-channel-id> | Teams channel id for the detractor alert |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Twilio | shared_twilio | SendMessage |
| Microsoft Dataverse | shared_commondataserviceforapps | SubscribeWebhookTrigger ListRecords UpdateRecord |
| Microsoft Teams | shared_teams | PostMessageToConversation |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Sentiment
- Run free-text comments through Azure AI Language / Text Analytics and store a sentiment label alongside the numeric score.
- Throttle
- Don't re-survey the same customer within N days (add a ListRecords lookback before queuing).
- Recovery case
- Auto-open a Dataverse case (or Teams task) for detractors instead of only posting an alert.
- Scoring
- The parser reads the first 1-5 token; extend Init Score to accept words (five) or NPS 0-10.
- Channels
- Swap Twilio SendMessage numbers to whatsapp:-prefixed values to run the same survey over WhatsApp.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Inbound sender / body
Reads the Twilio form-encoded fields
EXPR.02Score parse
First token if 1-5, else 0 (unscored)
EXPR.03Match the open survey
Most recent Sent survey for this phone
EXPR.04Low-score gate
Routes detractors to Teams
EXPR.05Correlation id
Row value or a new guid
EXPR.06TwiML reply
Instant thank-you TwiML
Customize & download
Generate a ready-to-import copy of this solution with your environment-variable values baked in — available on Base, Pro, or Team.
Upgrade to customize
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.