How to validate phone number format with country code in Memberstack forms for Twilio SMS via Zapier?
Hi everyone!
I’ve used Webflow + Memberstack + Zapier + Twilio to build a personal training site for a friend. However, to send texts once members sign up, Twilio requires you to add the country code (+1 in the US) before the 10 digit number.
We got our first signups last night, but the first 2 users didn’t add the +1 and didn’t get the text messages with training information. Is there a way to do form validation between Memberstack & Webflow?
My apologies if this has been covered elsewhere and thank you for any help or insight you can add!
-Ray
Comments
5 comments
A practical way to handle this is by using Script #195 – Custom Input Validation. That script lets you add real-time validation rules to your Webflow + Memberstack form fields, so you can enforce that phone numbers include the country code (like
+1for US) before submission. You can set up a regex pattern that checks for the+followed by the correct digits, and then display a custom error message if the user forgets it. This way, users get immediate feedback and you won’t have incomplete numbers slipping through to Zapier/Twilio.That said, if your main goal is to make the process easier for users, you could also combine #195 with a dropdown for country codes and then auto-append the selected code to the phone number field. Script #195 is best when you want real-time validation + custom error messages, while a dropdown approach may be simpler if you want to reduce user error altogether.
Hey Raymahl 👋
I would add a minLength attribute to the phone number field and set it to a number like 11 so they have to add the country code. Here is a screenshot of how that would look for the field in webflow.
Thank you, that worked perfectly!
Hey Ray! 👋
Congrats on those signups!
One way we do it is to include a step in Zapier between data collection and Twilio and run the numbers through the Formatter. Give it a search on Zapier and you’ll find it.
Thank you!
That’s really cool! I’ll def look into it for sure!
Please sign in to leave a comment.