When you create an export process, you can select to use queries or export definitions as the export type. There are benefits to each. This comparison shows an example, an export process for name badge stickers, where a query is appropriate and a variation on the example where an export definition is a better choice.
A simple Constituents query may have Name and Membership level as output fields.
If a constituent has one membership with one level, there is one line of output for the constituent:
Name: Robert Hernandez, Membership level: General
If you add two membership levels to the constituent’s membership, the results become three lines.
Name: Robert Hernandez, Membership level: General
Name: Robert Hernandez, Membership level: Distinguished
Name: Robert Hernandez, Membership level: Student
This query outputs three lines for one constituent because the relationship between the constituent and the membership levels is one-to-many. For one constituent, there can be many membership levels. In some cases, you might want to produce an output like this, where each line represents the constituent for a separate membership level.
With a query, you can filter, sort, and group these fields. For example, you can sort by Name to output each line for a specific constituent next to each other. One use for this output is, using Mail Merge in Microsoft Word or a similar program, to print badge labels for every constituent, with a separate label for each membership level stacked by order of constituents. In this case, Robert Hernandez would get three labels.
Robert Hernandez: General
Robert Hernandez: Distinguished
Robert Hernandez: Student
At other times, it may be more useful for you to output all that information to a single line. For example, with export definitions, you can set criteria for the output for one-to-many fields. This enables you to place all the membership levels for the constituent on one line. You can create the export definition with the same fields as the query:
Name
Membership level
However, with export definitions, when you select a one-to-many field, a screen appears that lets you set criteria for the fields contained in that node. For this example, when you select “Membership level,” the Criteria for Membership screen appears. You can select how many membership records to export per constituent. In this example, “3” is selected.
With queries, you can view results from the Results tab or export the results. With export definitions, you can only export the results. Also, with export definitions, you must choose a selection from which to export. For this example, the selection is one for individual constituents.
The export of this export definition contains one line with the same information for Robert Hernandez. Here are the values for each field:
BUSINESSPROCESSOUTPUT_PKID: 176
CONSTITUENTS_NAME: Robert Hernandez
CONSTITUENTS_MEMBERSHIP_MEMBERSHIPLEVELNAME: General
CONSTITUENTS_MEMBERSHIP_2_MEMBERSHIPLEVELNAME: Distinguished
CONSTITUENTS_MEMBERSHIP_3_MEMBERSHIPLEVELNAME: Student
You can use an output like this, along with Mail Merge in Microsoft Word or a similar program, to create one badge label per constituent that lists all of the membership levels. In this case, Robert Hernandez would get one badge label.
Robert Hernandez: General, Distinguished, Student