Output UNKNOWN for unlisted contact entry

16 views
Skip to first unread message

Nigel H.

unread,
Sep 24, 2016, 1:32:00 AM9/24/16
to Tasker
Hello all. I am new to Tasker and am loving it. I can now use my old phone with a broken screen with another working phone and it is awesome. However, I'm having a little trouble figuring out how to make a custom variable %con_name equal "UNKNOWN" when the %SMSRN isn't within my contacts. Right now, it is just outputting the contact phone number. Any help would be appreciated.

Pent

unread,
Sep 24, 2016, 2:25:53 AM9/24/16
to Tasker
You could e.g. check if it's equal to %SMSRA. If so, it's unknown.

Or catch that problem at the event/state level, see Pattern Matching
(section Caller Matching) in the Userguide.

Pent

Abdullah Alahdal

unread,
Sep 24, 2016, 5:03:08 PM9/24/16
to Tasker
You can use the Test Phone Action to check if %SMSRF returns a contact name otherwise it is unknown.

Test (197)
A1: Test Phone [ Type:Contact Name Data:%SMSRF Store Result In:%name Continue Task After Error:On ]
A2: If [ %name ~ *name ]
A3: Flash [ Text:Unknown Long:Off ]
A4: Else
A5: Flash [ Text:%name Long:Off ]
A6: End If

Nigel H.

unread,
Sep 24, 2016, 10:06:27 PM9/24/16
to Tasker
Thank you so much! Not only did it help me fix my problem, it also showed me that you can make conditional statements within the Task list. I  thought you could only do it within the actual Tasks and didn't realize you could do that. That makes everything else SOOO much easier. and more like regular programming. Thanks again!!!
Reply all
Reply to author
Forward
0 new messages