Dynamic Segments

In addition to static segments (manually assembled lists of contacts), DonorPoint supports dynamic segments — lists defined by a query that is re-evaluated each time the segment is used. Membership in a dynamic segment is always current as of the time it is queried.

Types of Dynamic Segments

Contact Query Segments

A Contact Query segment defines membership using filter criteria on contact fields, custom fields, giving history, and relationships. Contacts that match the criteria are included; those that do not are excluded. The query is re-run each time the segment is used for an email, report, or distribution.

Example uses:

  • All contacts who gave in the previous calendar year but not in the current year (LYBUNT)
  • All contacts whose employer is a specific organization
  • All contacts with a specific custom field value (e.g., department = “Marketing”)
  • All contacts who have not yet responded to the current workplace campaign

Organization Query Segments

An Organization Query segment applies the same logic to Organization records — useful for building distribution lists of employers or agency contacts.

Composite Contact Segments

A Composite Contact Segment combines other segments using two simple lists:

  • Include Lists — contacts in any of these segments are eligible for membership
  • Exclude Lists — contacts in any of these segments are removed from the result

The effective membership is (union of all include lists) minus (union of all exclude lists). This replaces the older Compound Segment model (Union / Intersection / Difference) with a single intuitive include/exclude pattern that covers the vast majority of real-world targeting needs.

For example, a “contacts with outstanding pledges” segment would have:

  • Include: “Contacts who pledged this year”
  • Exclude: “Contacts who have already paid”

Composite segments can include or exclude other composite segments, enabling layered logic.

The Contact Segment Hierarchy

Contact Groups (static), Contact Queries (dynamic), Custom Contact Queries (custom-coded), and Composite Contact Segments all share a common Contact Segment abstraction. This means anywhere a segment is accepted — distribution lists, item additional contacts, opportunity related contacts — you can use any of these types interchangeably.

The Ad-Hoc Query Builder

Contact Queries are built using a visual query builder that combines a column browser, expression editor, filter tree, and free-form SQL in a single interface. No SQL knowledge is required for most queries.

Building a Query

  1. Go to Segments in the sidebar.
  2. Click Create New Segment and select Contact Query (or Organization Query for an organization-targeted segment).
  3. Set the Root Entity — the type of record you are querying (Contact, Organization, etc.).
  4. Use the Columns panel to choose which fields appear in the result set, and the Filters panel to define which records to include.
  5. Save. The query is now available as a distribution list, report source, or contact list anywhere a segment is accepted.

Columns

Click Add Column to bring up the column picker. The picker shows the root entity’s properties; click any related-entity property (an organization, an order item, an event registration, etc.) to drill into it and pick a property from the related entity. You can cascade through related properties to arbitrary depth — DonorPoint walks the entire entity model and shows only valid properties at each step.

For each column you can set:

  • Column Label — a friendly display name shown in column headers; the underlying field name is preserved internally
  • Aggregate Function — apply COUNT, COUNT DISTINCT, SUM, AVG, MIN, MAX, or List (group-concat) over a one-to-many relationship — for example “List of purchase order amounts” or “Sum of event registrations”
  • Sort Direction — ascending, descending, or none

Filters

The Filters panel is a tree of conditions and groups.

  • Conditions test a single property against a value or another expression using operators like =, , >, <, contains, starts with, is empty, IN, EXISTS, NOT EXISTS, etc.
  • Groups combine conditions with AND, OR, or NOT, and can be nested to arbitrary depth.

The left side of a condition uses the same cascading property picker as columns — drill into related entities as deep as you need. The right side accepts either a literal value or an EL expression evaluated against the current record (e.g., #{purchaseOrder.amount} or #{contact.account.fundraisingYear}).

EXISTS / NOT EXISTS operators check whether any related child record matches a sub-condition — for example “Contact has an active recurring donation” or “Organization has at least one staff contact whose role is Director.”

Free-Form SQL Expressions

For cases the visual builder cannot reach, mark a column as Free-Form and write a raw SQL expression. The expression has access to the root entity alias and can use any SQL function the database supports, plus EL interpolation against the current entity. Common uses:

  • Conditional aggregates: SUM(CASE WHEN po.year = #{currentYear} THEN po.amount ELSE 0 END)
  • Computed strings: CONCAT(c.firstName, ' ', c.lastName)
  • Date math: DATEDIFF(NOW(), c.firstGiftDate)

Free-form SQL replaces the legacy SUM_IF, COUNT_IF, and AVG_IF aggregates, which have been retired in favor of the more flexible CASE expression pattern shown above.

Creating a Composite Contact Segment

  1. Go to Segments in the sidebar.
  2. Click Create New Segment and select Composite Contact Segment.
  3. Add segments to the Include Lists panel — these contribute candidates.
  4. Add segments to the Exclude Lists panel — these remove candidates.
  5. Save.

Using Dynamic Segments for Email

Dynamic segments can be used as email distribution lists just like static segments. When the email job runs, the dynamic segment is evaluated at that moment — meaning newly added or removed contacts are reflected automatically.

See Distribution Lists for how to use segments in email distributions.

LYBUNT / SYBUNT Targeting

A common use of dynamic segments is identifying prior donors for re-engagement. DonorPoint provides a built-in Giving Status Contact List that handles the most common lapsed-donor scenarios directly:

  • LYBUNT (Last Year But Unfortunately Not This Year): contacts with an active transaction in the prior campaign year and no active transaction in the current campaign year
  • SYBUNT (Some Year But Unfortunately Not This Year): contacts with any historical transaction but none in the current year

Create one from the Giving Status Contact List option in the Segments create menu, then filter by giving status (Active, Lapsed, New, etc.), minimum gift count, minimum lifetime giving, minimum last gift amount, and years without a gift.

If you need the LYBUNT/SYBUNT pattern with extra criteria layered on, build it with a Composite Contact Segment:

  1. Create a Contact Query for “gave last year” (active transaction, campaign year = prior year)
  2. Create a Contact Query for “gave this year” (active transaction, campaign year = current year)
  3. Create a Composite Contact Segment with the first segment as Include and the second as Exclude

Dynamic Segments in Reports

Dynamic segments are available as filters in reports. When a report is run with a dynamic segment filter, only records matching that segment’s current membership are included.

Open the segment and click the Reports tab to access reports scoped to that segment’s membership.