More than one 'contains text' filter possible?

Post your questions and help other users.

Moderator: Martin

Post Reply
akhileshg1988
Posts: 109
Joined: 16 Apr 2014 04:57

More than one 'contains text' filter possible?

Post by akhileshg1988 » 03 Jul 2017 10:37

Hey!
Just a query.
Can the trigger Notification on Statusbar Displayed be used along with the contains text Filter field to trigger a flow with two different contains text filters for the same app package?
I hope you get my question.
In other words, in the Notification on Statusbar Displayed trigger, with the package name set to one particular app, can I set more than one contains text filters? If yes, do they have to be separated using a comma?

Thanks
Akhilesh Chandra Gairola

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: More than one 'contains text' filter possible?

Post by Martin » 04 Jul 2017 19:22

Hi,

That's not possible directly since the contains text filter only allows one pattern. You could use matches regex which could be used to match multiple texts. Alternatively you can also leave the text filter empty and use one or multiple conditions Expression to check if one of the text variables of the notification contains a certain text. Yet another possibility is to defined multiple triggers in the same flow, each trigger would set the contains text filter for one of the values.

Regards,
Martin

akhileshg1988
Posts: 109
Joined: 16 Apr 2014 04:57

Re: More than one 'contains text' filter possible?

Post by akhileshg1988 » 05 Jul 2017 13:54

Martin wrote:You could use matches regex which could be used to match multiple texts.
Martin
I'd like to match the texts "Dialling" and "Incoming call" simultaneously in the trigger Notification on Statusbar Displayed using the trigger only once. Since I am not pretty good at regular expressions, could you please guide me what regex should I use so that both the aforementioned texts get included in the trigger?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: More than one 'contains text' filter possible?

Post by Martin » 06 Jul 2017 20:08

Something like this should work:
(?s).*Dialling.*|.*Incoming call.*

(?s) turns on DOTALL mode so . also matches newline characters. This is required since the text of the notification usually spans multiple lines and also contains the title of the notification.

Regards,
Martin

akhileshg1988
Posts: 109
Joined: 16 Apr 2014 04:57

Re: More than one 'contains text' filter possible?

Post by akhileshg1988 » 07 Jul 2017 03:32

Flawless. Works perfectly.
Thanks a lot Martin!

Post Reply