foreign-sapphire•2y ago
Can Voiceflow get User's phone number from Twillio incoming message
My voiceflow assistant is connected to voiceflow I want to get the user's phone number in a variable in voiceflow.
TIA
12 Replies
To get a user's phone number from an incoming Twilio message into a Voiceflow variable, you would typically use the integration capabilities between Voiceflow and Twilio. However, the provided information does not specifically detail the process for capturing a user's phone number directly from Twilio messages into Voiceflow variables.
For integrating Twilio with Voiceflow, especially for voice IVR applications, you might consider looking into the following resources for guidance and examples on how to set up and manage data between Twilio and Voiceflow:
- Voiceflow's documentation on Twilio Voice IVR integration.
- Open source examples and code repositories that might include examples of handling user data, such as phone numbers.
It's important to understand that handling personal data like phone numbers requires careful consideration of privacy and security measures. Ensure you're compliant with relevant regulations and best practices when capturing and storing user information.
For more detailed instructions and examples, you might find the following resources helpful:
- Twilio Voice IVR integration guide
- Voiceflow documentation
foreign-sapphireOP•2y ago
I have integrated my vioceflow assistant using the twillio SMS integration
If you haven't changed the integration code than the phone number is passed to the {user_id} variable automatically.
foreign-sapphireOP•15mo ago
Awesome!
Thanks
Hi @NiKo | Voiceflow Thank you so much for the help, The issue I'm facing is the first it gets the phone number correct, now if a different user sends an sms it still keeps the phone number of the first user. Do yo know how can we get that fixed?
foreign-sapphireOP•15mo ago
The phone that gets set is different than the phone saved with the transcript

Are you manually updating the phone number in your agent?
Because the integration should always return actual user's phone. Are you using the SMS or the IVR integration code?
foreign-sapphireOP•15mo ago
@NiKo | Voiceflow I'm using SMS.
As you previously said the phone number is set in "user_id" by default I'm using the user_id variable and assigning its value to another custom variable called "phone"
I also tried using the "user_id" variable directly
It also stores the first user's phone number only.
Try outputing the user_id right after the start block in a Text step: {user_id}
foreign-sapphireOP•15mo ago
I made a copy of my assistant and output the {user_id} in the text tried with 2 different phones and it got the numbers correct.
Do you think the issue was because i was assigning the {user_id} to another variable?
Or is there any caching going on in the integration?
No clue, but you should not be setting the user_id manually.
foreign-sapphireOP•15mo ago
Never was setting it manually. I'm letting the integration do its thing.
I was just assigning its value to another variable
That should work just fine
try that again and then output your new var