cant get this filter to work, which removes notifications that DON’T contain certain keywords

Post your questions and help other users.

Moderator: Martin

Post Reply
joego
Posts: 10
Joined: 19 Nov 2019 13:52

cant get this filter to work, which removes notifications that DON’T contain certain keywords

Post by joego » 19 Dec 2019 23:26

ive created a automagic to block notifications from a particular twitter account that donot contain the word “bet” but its not working, any idea what ive done wrong? https://dl3.pushbulletusercontent.com/W ... 163831.xml

User avatar
jassing
Posts: 94
Joined: 16 Jul 2017 01:42
Location: SF Bay Area

Re: cant get this filter to work, which removes notifications that DON’T contain certain keywords

Post by jassing » 20 Dec 2019 02:49

You don't have a trigger specified...
This is utterly untested but should get you going in the right direction... (I don't have Twitter, so you need to fill in that field)

joego
Posts: 10
Joined: 19 Nov 2019 13:52

Re: cant get this filter to work, which removes notifications that DON’T contain certain keywords

Post by joego » 28 Dec 2019 19:12

Is this the right expression to use if you only want to keep notifications that have the word "bet"?

contains(notification_text, "bet")

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: cant get this filter to work, which removes notifications that DON’T contain certain keywords

Post by Desmanto » 28 Dec 2019 20:23

@joego : yes. That expression will evaluted to 'true' if the notif text contain "bet" inside. Then use the true branch to go to your main branch of flow.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

joego
Posts: 10
Joined: 19 Nov 2019 13:52

Re: cant get this filter to work, which removes notifications that DON’T contain certain keywords

Post by joego » 29 Dec 2019 11:40

For some reason jassons script with that expression is not working, as you can see here it's not removing notifications that don't contain the word "bet" - any idea what changes I should make? https://i.imgur.com/6qNBvKP.png

download/file.php?id=1807

User avatar
jassing
Posts: 94
Joined: 16 Jul 2017 01:42
Location: SF Bay Area

Re: cant get this filter to work, which removes notifications that DON’T contain certain keywords

Post by jassing » 29 Dec 2019 22:17

Code: Select all

contains(notification_text, "bet")
This matches bet, better, nobet... It ignores "words"
You need to either NOT/! or use the false branch.

joego
Posts: 10
Joined: 19 Nov 2019 13:52

Re: cant get this filter to work, which removes notifications that DON’T contain certain keywords

Post by joego » 31 Dec 2019 19:30

Thanks, Would this be how i'd write the expression:

Code: Select all

contains NOT/!(notification_text, "bet")

User avatar
jassing
Posts: 94
Joined: 16 Jul 2017 01:42
Location: SF Bay Area

Re: cant get this filter to work, which removes notifications that DON’T contain certain keywords

Post by jassing » 31 Dec 2019 21:01

You would use either
The true branch of an expression

Code: Select all

NOT contain(notification_text, "bet")

Code: Select all

!contains(notification_text, "bet")
Or

Code: Select all

contains(notification_text, "bet") == false
Or the false branch of

Code: Select all

contain(notification_text, "bet")
A these match notification_text if the string 'bet' is not found. This doesn't care about words.

Post Reply