Page 1 of 1

trigger sms received

Posted: 15 May 2019 14:36
by younesetre
With trigger sms received, can i have trigger when sms contains keyword 1 or keyword 2? How i write it?

Re: trigger sms received

Posted: 15 May 2019 15:29
by Wibbly
Look at the traigger description here http://automagic4android.com/components ... ms_receive

There is a field you fill in the trigger which determines if it will trigger

---
Contains Text
Only executes the flow when the text of the SMS contains the given text (no wildcards supported). The text is not case sensitive.
---

So create flows with the SMS trigger, each with one of your keywords as the Contains Text.

Alternively, let it trigger for any sms (no Contains Text) and use the sms_text local variable the trigger populates, lower down in the flow, to look for the keywords and take appropriate actions

--
sms_text
the text of the SMS
---

Re: trigger sms received

Posted: 21 May 2019 00:36
by Pepy
younesetre wrote:
15 May 2019 14:36
With trigger sms received, can i have trigger when sms contains keyword 1 or keyword 2? How i write it?
Yes you can, but you will need to use multiple SMS Received triggers each one containing the keyword you want to look for under the "Contains Text" option since it does not support wildcards matching.

Alternatively, as Wibbly suggested above, you can also use one SMS Received trigger with the "Contains Text" field left empty. Then, add a Expression condition as follows:

Code: Select all

matches(sms_text, keyword1|keyword2|etc);