The Query Builder Explained

Introduction to the Query Builder

The Query Builder is a versatile tool that allows you to create customised queries to retrieve and manipulate your data. To make the most of it, you need to understand how to add rules, create groups, and filter by module. This help file will explain each concept step by step.


Adding Rules to Your Query Builder


What is a Rule?

A rule in the Query Builder represents a single condition that narrows down your search criteria. You can think of it as a building block for your query.

How to Add a Rule?

  1. Start by selecting a field you want to filter by from the available options. This field could be anything relevant to your data, such as a date, name, status or role.
  2. Once you've selected the field, choose an operator (e.g., equals, contains, is greater than) that defines how the field should be compared.
  3. Enter the value or criteria that the field should match or meet.
  4. Determine whether the rule should be evaluated using the AND or OR operator.
  • AND Operator:
    • If you choose the AND operator, your query will only return results that comply with ALL the specified rules.
  • OR Operator:
    • If you choose the OR operator, your query will return results that comply with AT LEAST ONE of the specified rules.

Example:

  • Field: "Role"
  • Operator: "Equal"
  • Value: "Account"
  • Operator: "OR"
  • Field: "Role"
  • Operator: "Equal"
  • Value: "Lead"

In this example, the query will return records where the "Role" field equals either "Account" OR "Lead".

If you need to add more conditions to your query, click on the "Add Rule" button to create as many additional rules as you want.


Adding a Group to Your Query Builder


What is a Group?

A group allows you to combine multiple rules together with logical operators (AND, OR) to create more complex conditions.

How to Add a Group?

  1. Click on the "Add group" button within the Query Builder interface.
  2. You can nest rules within groups by using the logical operators AND or OR to determine how the rules within the group should be evaluated.
  3. Add rules inside the group as needed.

Example:

  • Group 1 (AND)
    • Rule 1: Region Equal Gauteng
  • Group 2 (OR)
    • Rule 1: Date First Payment is Between 1 July 2023 and 31 August 2023
    • Rule 2: Date Joined is Between 1 July 2023 and 31 August 2023

In this example, the query will return records of everyone in Gauteng who either made their first payment between 1 July 1 2023, and 31 August 2023, or joined between the same dates.

If you need to add more conditions to your query, click on the "Add group" button to create as many additional groups as you want.


Filtering by Module


What is Filtering by Module?

Filtering by module allows you to specify the data source or module from which your query will retrieve information. Modules are predefined categories of data within the system.

How to Filter by Module?

  1. In the Query Builder interface, locate the "Filter by Module" option.
  2. Select the module that you want your query to focus on. This ensures that your query is applied to the specific type of data you need.

Example:

  • Module: "Lists"
  • Rule: List Name Equals "Lind Group"

In this example, the query will retrieve contacts listed under Lind Group because we've specified the "Lists" module and set the rule to filter by the name of this list "Lind Group".

If you need to add more conditions to your query, click on the "Filter by module" button to create as many additional rules as you want.


By understanding and effectively using rules, groups, AND/OR operators, and module filtering, you can create precise and powerful queries in the Query Builder to extract the exact data you need from your system. This level of control allows you to harness your data for better decision-making and improved workflow management.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.