trigger sms received

Post your questions and help other users.

Moderator: Martin

Post Reply
younesetre
Posts: 16
Joined: 29 Apr 2016 23:04

trigger sms received

Post by younesetre » 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?

Wibbly
Posts: 418
Joined: 17 Mar 2014 09:02

Re: trigger sms received

Post by Wibbly » 15 May 2019 15:29

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
---

Pepy
Posts: 76
Joined: 31 Oct 2018 10:53
Location: Canada

Re: trigger sms received

Post by Pepy » 21 May 2019 00:36

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);
Hope my post was helpful :D
Device: OnePlus 5T running crDroid, rooted with Magisk 8-)

Post Reply