cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

SMS PowerApp with Twilio connector

Hello,

 

I'm wanting to integrate Twilio in to a Power App - I've been doing some testing and need some assistance.

 

Essentially I'm wanting to design a Power App whereby the end user clicks a 'Send SMS' button and is then prompted to enter the text they'd like to send in the SMS message. Also, I'm not sure if it's possible to add a list of numbers that the message will go to in Twilio.

 

Thanks in advance

Alex

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Resident Rockstar
Resident Rockstar

Re: SMS PowerApp with Twilio connector

@AlexJohnH 

You can add all recipients to one multiline textbox and loop through it like this:

ForAll(Filter(MatchAll(YourMultiLineTextInput.Text,"(.*)",MatchOptions.Multiline),FullMatch<>""),Twilio.SendMessage("15552603109",FullMatch,"Hello, World!"););

The numbers will need to be on their own line of the textbox. 

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

View solution in original post

12 REPLIES 12
Highlighted
Resident Rockstar
Resident Rockstar

Re: SMS PowerApp with Twilio connector

Yes, this is all possible. You'll just need to setup a Power Automate job that accepts a message input from PowerApps, runs a Twilio Send Message command and optionally returns a result to PowerApps.
For multiple numbers, you can send those in one batch like a group message using a semicolon separator or loop through the numbers using ForAll() in PowerApps or Apply to Each in Power Automate.

There is also a Twilio connector built straight into PowerApps, but it gives a little less control (last time I used it, which was a couple months ago). It should be straight forward, but if you have a specific question about that let me know.

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

Highlighted
Community Champion
Community Champion

Re: SMS PowerApp with Twilio connector

You can also follow this post. It deals with it.
https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-send-a-Text-Message/m-p/138983#M47890
Also watch:
https://youtu.be/9x3aJkV0s1Q

If you like this post, give a thumbs up. Where it solved your issue, Mark as a solution
Highlighted
Regular Visitor

Re: SMS PowerApp with Twilio connector

Thanks for coming back to me. Just need some assistance with getting a text input from Power Apps that will in turn be the Twilio message.

 

For instance the user will access the power app and see a 'Send SMS' button. Once they click on this button  it should prompt the user to enter the text that will be used for the Twilio SMS.

Highlighted
Resident Rockstar
Resident Rockstar

Re: SMS PowerApp with Twilio connector

@AlexJohnH 

Here is a great resource for adding a popup in PowerApps, which you can use for your textinput control. In their example, they add a label for a confirmation, but you can just use a textinput with cancel/send buttons.

Your formula would then look like this

Twilio.SendMessage(fromNumber,toNumber,TextInput1.Text)
Highlighted
Regular Visitor

Re: SMS PowerApp with Twilio connector

@EricLott 

 

Sorry, I cannot see the resource you're referring to? Although, I've just added the text input in to a new screen - so would be helpful to reference that resource to get the formula correct.

Highlighted
Resident Rockstar
Resident Rockstar

Re: SMS PowerApp with Twilio connector

@AlexJohnH 

I guess it would help if I added the link..

https://www.youtube.com/watch?v=_Dc0wJx9EN0

Highlighted
Regular Visitor

Re: SMS PowerApp with Twilio connector

@EricLott 

 

Thanks for that, quite an intuitive video. Right, so I have the below formula:-

 

Twilio.SendMessage(fromNumber,toNumber,TextInput1.Text)

 

You'll have to excuse me but this is my first time using the Twilio connector in conjunction with Power Apps, so how do I actually input the from/to number int to the formula? 

Highlighted
Resident Rockstar
Resident Rockstar

Re: SMS PowerApp with Twilio connector

@AlexJohnH 

You can either hard-code it like this

Twilio.SendMessage("15551234567","15557654321",TextInput1.Text)

Or set the variable values like this in your App's OnStart property, your form's OnVisible property, or any other property that begins with "On..."

Set(fromNumber,"15551234567");
Set(toNumber,"15551234567");

 Or if you'd like another text input for the to/from numbers, you can add those the same way you did the message text.

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

Highlighted
Regular Visitor

Re: SMS PowerApp with Twilio connector

@EricLott 

 

That's great. I've set the from/to numbers using the App OnStart property - so those are now specified and seem to be fine. The only issue I'm having now is that it's not liking the text input.

 

Twilio.SendMessage(fromNumber,toNumber,'SMS Text Input')

 

I'm entering the text that I'd like the SMS to read but it's failing. The App checker is claiming that 'Twilio.SendMessage failed: The method 'SendMessage' has an invalid value for the parameter 'From'.

 

Location Button5.OnSelect

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (5,836)