Query Builder
Query Builder allows you to define what type of information you want to find, and how you want to filter that information. Define the type of information you want with the Field Type and Field menus. Filter that information with the Clause and Operator buttons.
The Field Type menu lists the types of data stored in your database that can be queried. The options in this list are specific to your database configuration. If you do not see the type of information you want to query, contact Blackbaud Support.
Note: Each option in the Field Type menu is associated with its own Field menu.
The Field menu lists specific data related to the Field Type. If you do not see the information you want to query in the Field menu, try a different Field Type menu option.
See the examples below for the Field dropdown menus associated with Biographical Information and Address Field Type.
Use the Clause buttons to specify how you want to filter data to a particular range or value. Each clause created appears in the box on the Query Details screen.
Note: You must include at least one clause in your query. Multiple clauses can be used to narrow down the results for one or many different Field Type and/or Fields.
There are four Clause buttons: Add Field Clause, Add Group Clause, Add an Interaction Clause, and Add an Action Alert Clause. Each button opens a new window with filter options.
Field Clause
The Field selected determines which filters are available. See the comparison below of the Date of Birth and Occupation field clause windows.
Group Clause
All existing groups appear in the Group Type list. Selecting a group populates the column to the right with additional subgroups if available. Multiple groups can be selected. See the Selected column in the example below.
Interaction Clause
Interaction clauses filter data based on how constituents interact with your website and organization. Filter by campaign, event, donation form, registration form, and more. Some interaction selections open additional filtering options as illustrated below.
Like with group clauses, you may select one or multiple interactions.
Action Alert Clause
Action alert clauses target constituents eligible to participate in specific calls to action. This window provides a list of Action Alerts created in the Advocacy interface.
Group clauses with the operator buttons located on the left side of the screen.
To add an operator, select a clause in the box to the right of the operator buttons, and then click an operator button.
The query example below uses AND, OR, (, and ) operators.
In this example the query returns constituents who have listed an occupation if they also have indicated they are from or currently reside in Indiana, and anyone who has purchased an event ticket. So who does that include?
Name | Occupation Known | From Indiana | Currently Living in Indiana | Event Ticket Holder | Included in Query |
---|---|---|---|---|---|
Alice | X | X | Yes! Alice listed her occupation and is from Indiana. | ||
Bob | X | X | Yes! Bob listed his occupation and is living in Indiana. | ||
Charlotte | X | Yes! Charlotte did buy a ticket. | |||
David | X | No. David did not list his occupation and he did not buy a ticket. | |||
Elaine | X | No. Elaine did not list an occupation and she did not buy a ticket. | |||
Frank | X | No. Frank listed an occupation, but he did not indicate that is from, or currently lives in, Indiana. | |||
Georgia | X | X | Yes! Georgia did buy a ticket to an event. |