Grooper Help - Version 25.0
25.0.0017 2,127
  • Overview
  • Help Status

Database Lookup

Lookup Specification Grooper.Core

Performs a lookup against a database to validate or populate Grooper fields using the results of an SQL query.

Remarks

The Database Lookup class enables Grooper to execute SQL queries against a configured Data Connection, using the results to validate field values or populate additional fields within a document's data model.

Overview

  • Executes a user-defined SQL query, typically referencing Grooper field values as parameters.
  • Supports both validation-only and field population scenarios.
  • Integrates with Grooper's data extraction and validation workflows, allowing dynamic data enrichment from external databases.

Configuration

  1. Database Connection
    Select a Data Connection to specify which database will be queried.

  2. SQL Query
    Define the SQL query to execute. Use @VariableName syntax to reference Grooper field values in the WHERE clause.

    • The SELECT clause should include all columns needed for field population, using aliases to match Grooper field names as necessary.
    • For validation-only lookups, select only the minimal required columns for efficiency.
  3. Field Mapping

    • Fields referenced in the WHERE clause are used as lookup criteria.
    • Fields matching column names (or aliases) in the SELECT clause are populated with returned values if field population is enabled.
  4. Result Handling

    • If the query returns exactly one row, the lookup is considered a hit.
    • If no rows are returned, or multiple rows are found, behavior is controlled by the 'Miss Disposition' and 'Conflict Disposition' properties.

Usage Scenarios

  • Field Validation: Ensure that a field value exists in an external database (e.g., validating a purchase order number).
  • Auto-Population: Retrieve and fill in related data (e.g., vendor name, address) based on a key field.
  • Reference Data: Enforce valid value lists or cross-reference document data with authoritative sources.

Best Practices

  • Use aliases in the SELECT clause to ensure returned column names match Grooper field names for population.
  • Test queries in the native database editor before pasting into Grooper for complex or platform-specific SQL.
  • Limit the result set to a single row for best results; handle multi-row results using the appropriate disposition settings.
  • Use the query editor's intellisense to assist with table, column, and variable names.

For more information, see the documentation for Data Connection, Lookup Specification, and Grooper's data extraction workflow.

Properties

NameTypeDescription
General
Lookup Options
Lookup Info

See Also

Used By

Notification