This page covers the basics about the Query Builder in Specify 7. For more information and guidance, see our comprehensive members-only documentation: Using the Query Builder.
Introduction to the Specify Query Builder
One of the greatest advantages of managing biological and geological collections in a structured database is the ability to retrieve your data efficiently, precisely, and consistently. In Specify 7, this is powered by the Query Builder—a flexible, visual interface that allows you to search, filter, and extract records from across your entire database without needing to write complex database code.
What is the Query Builder?
The Query Builder is a tool designed to let you build custom searches based on criteria across any data field in Specify. It allows you to select a “base table” (such as Collection Object or Accession) and then trace relationships to other tables in your schema (like pulling cataloger details from the Agent table, or geographic details from Locality).
Unlike a simple global keyword search, a query is a precise request for information retrieval. You can restrict the returned records based on explicit conditions, logical operators, and specific formatting rules defined in your collection data model.
Key Capabilities & Use Cases
The Query Builder goes far beyond basic searching. Here is what you can accomplish with it:
- Filter Data with Powerful Operators: You can apply detailed constraints to fields using standard relational operators such as
Contains,Starts With,Is Empty,Between(great for date ranges), or mathematical comparisons for numeric values. - Navigate Complex Relationships: You can easily query “through” tables. For example, starting at the Collection Object table, you can map to the linked Collecting Event table, step further into Locality, and query based on the
NamedPlacefield—all within the same visual editor. - Generate Record Sets: Once a query executes, you can convert your search results directly into a Record Set. Record Sets act as static cohorts of records that you can save, share with colleagues, bundle for data entry, or use for batch operations.
- Power Reports and Data Exports: Query Builder serves as the foundation for exporting and transforming data. Export result sets as CSV, create the basis for Darwin Core Archive exports or pipe the results into Specify’s report runner to print physical labels, ledgers, or loan invoices.
- Data Cleanup and Batch Editing: Record merging and batch editing are two fantastic tools that both stem from a query.
How to Get Started
Building a new query in Specify 7 takes only a few simple steps:
- Click on
Queries in your sidebar navigation menu.
- Click the New button.
- Select your target Base Table (for example, Collection Object).
- Use the field mapper interface to navigate through fields and related tables. Click the green
+icon next to fields to add them as columns in your query. - Define your sorting preferences, toggle visibility checkboxes, and type your target parameters into operator fields.
- Click the Query button to fetch your data.