Smart Queries

Smart queries are needed when you need to perform a series of complex calculations using parameters  and business logic. The output fields from a smart query are fixed. Meaning that you can’t pick and choose which columns you want from within the smart query. However, if you create a selection from the smart query, you can then leverage that selection from within an ad-hoc query. Remember that a selection created from a  smart query only contains a set of identifiers from the query not the columns themselves. If you utilize a selection from within ad-hoc query, you must add any columns that you want to see yourself. For example, if you create a smart query from the Constituent by Last Revenue Smart Query template, the results can be saved as a selection for use in other processes, such as when generating appeal mailings or other types of correspondence. You might, for example, try to re-engage donors who haven’t given a gift in the last 3 years.

When you create smart queries you must first specify the source query definition (template) from which the smart query should be created. This determines the type of records that will be included. Then you can define parameters specific to the selected template. A selection can be created from the results of the smart query. The created selection can be either static (a snapshot of the current results) or dynamic (results are updated each time the selection is used). Infinity comes with a pre-defined list of smart query definitions. If you can not find a smart query definition that meets your needs, then an Infinity SDK software developer can create a new definition using a SmartQuerySpec that contains the parameters, calculations, and output fields that meet your specific requirements.