0

I am planning to have multiple phone numbers (Whatsapp for example), routed to the same Twilio Flow.

As per https://www.twilio.com/docs/studio/user-guide, I should be expecting a Twilio phone number that I can use to split the flow by:

Flow Variables include:
The Flow's Execution Sid: flow.sid
The Flow's address (e.g. Twilio phone number): flow.channel.address

When I tried this on a Whatsapp Sandbox it returned my channel SID instead. How else can I split my flow to different branches depending on my Twilio phone number (not to be mistaken with the customer's phone number) that the customer is connecting with?

As a note, I understand this can be done by assigning different Flows to different phone numbers, but it seems like an unncessary duplication.

OCC
  • 5
  • 1
  • 2

1 Answers1

0

It should be {{trigger.message.To}}. That will return the Twilio number the person sent the WhatsApp message to. You can use this varible in the Split Based on Widget to route to to a particular path in the shared Studio flow.

You can look at the Studio execution logs for for your Studio flow (under Logs > Click an Execution SID > Expand Trigger > Click on Widget & Flow Properties).

Alan
  • 10,465
  • 2
  • 8
  • 9
  • Thanks @Alan. I have just tried that and and `{{trigger.message.To}}` returned the same value as `{{trigger.message.ChannelSid}}`. I am not sure if this could just be a Whatsapp Sandbox specific issue, and will resolve itself once I move out of sandbox? – OCC Feb 08 '21 at 07:56
  • After some fiddling around, `trigger.message.ChannelAttributes.twilioNumber` gave me what I was looking for. Marking your solution anyway as that led me to look at the right place – OCC Feb 08 '21 at 11:26
  • It sounds like possibly Twilio Flex is involved somewhere? – Alan Feb 08 '21 at 12:37
  • yes I am using Flex to manage the conversations but didn't think that would cause any complications in the studio layer of things? – OCC Feb 08 '21 at 13:46
  • Flex just handles some fo the messaging differently vs. sending it directly into Studio. – Alan Feb 08 '21 at 17:56
  • Fair enough, I just figured out that Flex doesn't handle whatsapp location messages yet hah, so definitely taking your word that it works differently – OCC Feb 08 '21 at 20:06