Query (NotesAgent - JavaScript)

Read-only. The text of the query used by an agent to select documents.

Defined in

NotesAgent

Syntax

getQuery() : string

Usage

In the Agent Properties box, a query is defined by the searches added to the agent using the Add Search button. If no query is defined with the Add Search button, the Query property returns an empty string, even if the agent runs a formula that has its own SELECT statement or a script that selects specific documents.
Some sample results:
  • If an agent searches for documents that contain the word "tulip," Query returns:
    ("tulip")
  • If an agent searches for documents that contain the word tulip and were created on September 19, 1996, Query returns:
    ("tulip") AND ([_CreationDate] = 09/19/96)
  • If an agent searches for documents that use the Response form, Query returns:
    (([Form]="Response"))
  • If an agent searches for documents that use the Response form and contain the phrase "mustard greens" in the Subject field, Query returns:
    (([Form]="Response")) AND ([Subject] CONTAINS (mustard greens))