Configuring Your Account
Understand Billing
Publishing
Analytics & Reporting
Engagement
AI and Automation
Social Listening
Sprout Integrations
Tagging
Customer Care
Salesforce Service Cloud
Instagram
Facebook
X
Tiktok
Threads
WhatsApp
LinkedIn
YouTube
Pinterest
Bluesky

How do I use the advanced keyword query in Automated Rules?

Table of Contents

Sprout’s Automated Rules help streamline message management by applying conditions to trigger specific actions. One of the most powerful and commonly used conditions is keyword-based matching.

To give you more control and flexibility when building keyword rules, Sprout offers a Boolean Query Editor. This advanced option allows you to create complex keyword criteria using Boolean logic, wildcards, proximity matching, and more. The Boolean Query Editor makes it easier to build accurate, efficient, and scalable rules.

This feature lets you enter a Lucene query directly, making it a powerful option for advanced users who are comfortable with Lucene-style search syntax.

Users will need Manage Advanced Inbox Features permission and Manage profiles & permissions access to create rules.

How to use the Boolean Query Editor

  1. Open or create an automated rule
  2. Select the Message Criteria → matches the advanced keyword query

    f78f4ec5-b1ef-40b9-a356-65abbd2896ed.png
  3. Type your custom boolean query in the editor box

    881e210a-2a42-4a0c-b320-b590f3aac39b.png
  4. Click the View supported query operators if you need help with supported query operators and example queries

    ab13b824-2d14-4a7f-9306-3e254c636462.png
  5. (If needed) combine your boolean query with other criteria using the AND/OR buttons under the query editor box
  6. Select the actions you wish to take for the rule
  7. Save your rule

Our system can handle up to about 30-40 full boolean queries combined with OR in a single rule. This is a very advanced use case and not something we generally recommend.

Supported Operators for Boolean Query Editor

Function

 

Operator

 

Example

 

Description

 
multiple words   Chicago Pizza Containing both "Chicago" and "pizza" but not as an exact phrase. The lack of "" around the phrase defaults to placing an AND between individual words
exact word or phrase "" "Chicago pi$$a" Containing exact phrase “Chicago pi$$a”. This is the only operator where special characters are accepted
both words AND tacos AND pizza Containing both "tacos" and "pizza"
either word OR hotels OR motels Containing either "hotels" or "motels" (or both)
exclude NOT "Mexican food" NOT tacos Containing "Mexican food" but not tacos
exclude groups NOT () authentic food NOT (Italian OR Mexican) Containing both "authentic" and "food" but not "Italian" or "Mexican"
exclude phrase NOT "" or - Social NOT "social media"
Social -"social media"
Containing "social" anywhere in the message, but not "social media"
complex groups ( OR ) (pepperoni OR mushroom) pizza Containing either "pepperoni" or "mushroom" and "pizza"
complex groups ( ) OR (taste good) OR delicious Containing both "taste" and "good" or "delicious
proximity match ""~# "foo bar"~4 Containing "foo" and "bar" within 4 words of each other
wildcard matching * foo* Containing any words that begin with "foo", such as "fool", "foolish", "fooling", etc

Was this article helpful?

0 out of 0 found this helpful

Table of Contents