imagetwiliotwilio-studio

How to determine if an SMS Message has Images Using Twilio Studio?


How do I check if an SMS message has an image or not? I'm using Twilio Studio.

enter image description here

enter image description here

enter image description here

Is there a way to check for BOTH a .jpg (+ .jpeg) and a .png?


Solution

  • Instead of checking the trigger.message.Body which contains the text of the message, you should check trigger.message.NumMedia which tells you how many images were sent.

    You can then add transitions to test whether NumMedia is "0" or if matches any of "1" through "10".