Overview of User-Defined Queries

User-defined queries are reusable query definitions that extract data based on criteria that you define.

Use a user-defined query when you have complex data-extraction requirements, such as extracting data from multiple tables, that standard views don't meet.

When you create a user-defined query, you provide a name and query definition, and associate the query with a pillar and family. You can also add tags to help identify and find the query.

After you create a user-defined query, you can add it to an extract definition. You can then run the extract definition immediately or schedule it to run at a later time.

Execution Modes

Select an execution mode based on how the query will run.
  • Synchronous: The request waits until the query finishes and returns the result. Use this mode for queries that complete quickly when the calling process requires the result immediately.

  • Asynchronous: The request starts the query and returns without waiting for completion. The query runs in the background, and you can monitor the job and retrieve the output after it completes. Use this mode for long-running queries or large-volume extracts.

Callback Feature

For an asynchronous user-defined query that you add to an extract definition, you can enable a callback. When the extract is complete, Data Extraction sends completion details to the configured callback workflow agent for further processing.

For example, the workflow can send an email notification or send the completion details to an external REST service.

For setup instructions, see Configure a Callback Workflow Agent.

User-Defined Query Lifecycle

You can perform the following tasks for a user-defined query:
  • Create a query and define the data to extract.

  • Add the query to one or more extract definitions.

  • View the extract definitions that use the query.

  • Edit a query when its definition or other details change.

  • Delete a query that is no longer required.