Query Documents activity

An activity that executes a query to get one or more documents from a MongoDB collection.


Query Documents activity

Configure the Query Documents activity

To configure the Query Documents activity, do the procedure in this topic.

Prerequisites

Good to Know

How to Start

  1. Open Process Builder.

    For information about how to open this screen, refer to Process Builder.


    Open Process Builder
  2. In Process Builder, in the Activity Library, open the MongoDB tab.

    Open MongoDB tab
  3. On the MongoDB tab, drag the Query Documents activity onto your process.

    Drag Query Documents activity

General Configuration

Specifies the basic settings for the Query Documents activity.

Figure: General Configuration screen

General Configuration screen

Good to Know

  • Documentation for this screen is provided for completeness. The fields are mostly self-explanatory.

Fields

Field NameDefinition

Display Name

Function:
Specifies the activity name that shows in your process.
Accepted Values:
One line of text that can have spaces.
Default Value:
None
Accepts Process Data Variables:
No
Example:
This is a common configuration field that is used in many examples. Refer to:
  • Examples - Step-by-step use case examples, information about what types of examples are provided in the AgilePoint NX Product Documentation, and other resources where you can find more examples.

Description

Function:
Specifies an optional text description for your activity.
Accepted Values:
More than one line of text.
Default Value:
None
Accepts Process Data Variables:
No

Query Documents Configuration > Filter Condition

Specifies the conditions for a query to get one or more documents from MongoDB collection.

Figure: Query Documents Configuration > Filter Condition tab

Query Documents Configuration Condition tab

Fields

Field NameDefinition

MongoDB

Function:
Specifies the access token that connects to your MongoDB.
Accepted Values:
A list of access tokens configured for your environment.
Default Value:
None
Accepts Process Data Variables:
No

Create Add Token icon

Opens this Screen:
Access Token for MongoDB
Function of this Screen:
Configure an access token to connect to MongoDB.

Database

Function:
Specifies the name of your MongoDB database.

When you select an access token, the databases associated with the MongoDB shows in this field.

Accepted Values:
A database name from the list.
Default Value:
None
Accepts Process Data Variables:
Yes

Collection

Function:
Specifies the MongoDB database table name.

When you select a database, the table names associated with the database show in this field.

Accepted Values:
A table name from the list.
Default Value:
None
Accepts Process Data Variables:
Yes

Code Snippet

Function:
Shows the SQL code snippet that is created when you configure the filter condition for your query.
Accepted Values:
Read only.
Default Value:
None

Create Create icon

Opens this Screen:
Query Documents Configuration > Create Filter Condition
Function of this Screen:
Configures the condition to use in your query to filter documents.
Limitations:
This field is available in these releases:

Delete Delete icon

Function:
Deletes the query from the code snippet.

Edit Edit icon

Function:
Lets you change the query.

Query Documents Configuration > Create Filter Condition

Configures the condition to use in your query to filter documents.

Figure: Query Documents Configuration > Create Filter Condition

Query Documents Configuration Create Conditions screen

Prerequisites

Fields

Field NameDefinition

Add expression Add Expression icon

Function:
Creates a condition row.

Add group Add Group icon

Function:
Creates a new conditional expression group.

Delete Delete icon

Function:
Deletes the condition row.

Select Nest Type

Function:
Specifies the use of logical AND and OR operators to nest conditions to filter documents.

You must set the condition first, before you specify the nest type.

Accepted Values:
  • And - Specifies the logical AND operator.
  • Or - Specifies the logical OR operator.
Default Value:
AND

Column Name

Function:
Specifies the name of the MongoDB column.

When you select a table name, the column names associated with the table show in this field.

Accepted Values:
An column name from the list.
Default Value:
None
Accepts Process Data Variables:
No

Condition

Function:
Specifies the operator to use in your condition.
Accepted Values:
  • =
  • >
  • >=
  • <
  • <=
  • !=
  • Exists
Default Value:
=

Value

Function:
Specifies the value for the column.
Accepted Values:
A valid column value.
Default Value:
None
Accepts Process Data Variables:
Yes
Limitations:

Some information about third-party integrations is outside the scope of the AgilePoint NX Product Documentation. It is the responsibility of the vendors who create and maintain these technologies to provide this information. This includes specific business use cases and examples; explanations for third-party concepts; details about the data models and input and output data formats for third-party technologies; and various types of IDs, URL patterns, connection string formats, or other technical information that is specific to the third-party technologies. For more information, refer to Where Can I Find Information and Examples for Third-Party Integrations?

Data Type

Function:
Specifies the data type for your column.
Accepted Values:
  • String
  • Number
  • Boolean
  • ObjectId
Default Value:
String

Back Back icon

Function:
Saves your rule and goes back to the activity configuration screen.

Query Documents Configuration > Response tab

Configures the connection from MongoDB database response parameter to your process schema.

Figure: Query Documents Configuration > Response tab

Query Documents Configuration Response tab

Fields

Field NameDefinition

MongoDB

Function:
Specifies the access token that connects to your MongoDB.
Accepted Values:
A list of access tokens configured for your environment.
Default Value:
None
Accepts Process Data Variables:
No

Create Add Token icon

Opens this Screen:
Access Token for MongoDB
Function of this Screen:
Configure an access token to connect to MongoDB.

Database

Function:
Specifies the name of your MongoDB database.

When you select an access token, the databases associated with the MongoDB shows in this field.

Accepted Values:
A database name from the list.
Default Value:
None
Accepts Process Data Variables:
Yes

Collection

Function:
Specifies the MongoDB database table name.

When you select a database, the table names associated with the database show in this field.

Accepted Values:
A table name from the list.
Default Value:
None
Accepts Process Data Variables:
Yes

Save Response To This Variable

Function:
Specifies the process data variable to store the JSON payload at runtime.
Accepted Values:
A process data variable that accepts an alphanumeric string in JSON format.
Default Value:
None
Accepts Process Data Variables:
Yes
Example:
[{ "_id" : ObjectId("59a392f9469ab4a19adaa0fe"), "title" : "Star Wars: Episode IV - A New Hope", "year" : 1977.0, "rated" : "PG", "runtime" : 121.0, "genres" : ["Action", "Adventure", "Fantasy"], "director" : "George Lucas" …}]

Map Response to Process Schema

Function:
Specifies the connection from the MongoDB API response parameter to your process schema.
Accepted Values:
Click the Schema Mapping Schema Mapping icon button to open the Schema Mapper.

Use this screen to connect the response to the data model for your process.

Default Value:
None
Example:
Refer to: