Auto-Lookup > SharePoint > SharePoint (CAML) > Multiple Columns

This topic shows how to create a lookup with SharePoint as the data source and uses a CAML query based on multiple columns for the Auto-Lookup form control.

Background and Setup

Examples

Good to Know

How to Start

  1. On the Auto-Lookup form control configuration screen, on the Configure tab, click Add Lookup.

    For information about how to open this screen, refer to Auto-Lookup form control.


    Click Add Lookup
  2. On the Select Data Source Type screen, select SharePoint.

    Select SharePoint
  3. Click Next.

SharePoint Type

Specifies the type of SharePoint lookup.

Figure: SharePoint Type screen

SharePoint Type screen

Good to Know

Fields

Field NameDefinition

SharePoint Type

Function:
Specifies the type of SharePoint lookup to create.
Accepted Values:
  • SharePoint Lookup - Creates a SharePoint lookup with a CAML query.
  • SharePoint Term Set Lookup - Creates a SharePoint lookup that uses metadata values.
Default Value:
SharePoint Lookup

Lookup Details

Specifies the basic configuration for a lookup.

Figure: Lookup Details screen

Lookup Details screen

Good to Know

Fields

Field NameDefinition

Access Token

Function:
Specifies the access token that connects to your data source.
Accepted Values:
A list of access tokens configured for your environment.
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.

Add New Add New icon

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

Lookup Name

Function:
Specifies the name you want to give to your lookup procedure.
Accepted Values:
One line of text that can have spaces.
Default Value:
None
Accepts Process Data Variables:
No
Example:
Refer to:

Lookup Type

Function:
Specifies the type of lookup procedure to do.
Accepted Values:
  • Name/Value - The lookup gets data for specified name/value pairs.
  • Multiple Columns - The lookup gets data for more than one column.
Default Value:
Name/Value
Example:
Refer to:

Configure Lookup > View Fields tab

Configures a lookup to create a view from the available fields, or columns, in a SharePoint list.

Figure: View Fields tab

View Fields tab

Fields

Field NameDefinition

Site URL

Function:
Specifies the URL for your SharePoint site.
Accepted Values:
A valid SharePoint site URL.
Default Value:
None
Accepts Process Data Variables:
Yes
Example:

Configuration Mode

Function:
Specifies how to configure the WHERE clause for the lookup.
Accepted Values:
  • Quick Configuration - Lets you quickly create a WHERE clause to configure the lookup.
  • Advanced - Lets you manually create a WHERE clause to configure the lookup.

    You can select Advanced if you select Multiple Columns in the Lookup Details screen. When you select Advanced, only the CAML Query, Test Query, and Error Messages tabs are available for configuration.

Default Value:
Quick Configuration

List Name

Function:
Specifies the name of your SharePoint list.
Accepted Values:
  • The name of your SharePoint list.
  • A process data variable.

    You can use Data Model screen to specify a process data variable.

Default Value:
None
Accepts Process Data Variables:
Yes

Name

Function:
The name of an item, such as a property or attribute in a name/value pair.
Accepted Values:
One line of text (a string) with no spaces.
Default Value:
None

Value

Function:
The value for an item, such as the value for a process data variable in a key-value pair.
Accepted Values:
A valid object value.
Default Value:
None

Show All Fields

Function:
Specifies if all the name/value fields show.
Accepted Values:
  • Selected - All the name/value fields show.
  • Deselected - All the name/value fields do not show.
Default Value:
Deselected

Configure Lookup > Where Clause tab

Configures a Where clause to filter the results of a CAML query.

Figure: Where Clause tab

Where Clause tab

Fields

Field NameDefinition

Site URL

Function:
Specifies the URL for your SharePoint site.
Accepted Values:
A valid SharePoint site URL.
Default Value:
None
Accepts Process Data Variables:
Yes
Example:

Configuration Mode

Function:
Specifies how to configure the WHERE clause for the lookup.
Accepted Values:
  • Quick Configuration - Lets you quickly create a WHERE clause to configure the lookup.
  • Advanced - Lets you manually create a WHERE clause to configure the lookup.

    You can select Advanced if you select Multiple Columns in the Lookup Details screen. When you select Advanced, only the CAML Query, Test Query, and Error Messages tabs are available for configuration.

Default Value:
Quick Configuration

List Name

Function:
Specifies the name of your SharePoint list.
Accepted Values:
  • The name of your SharePoint list.
  • A process data variable.

    You can use Data Model screen to specify a process data variable.

Default Value:
None
Accepts Process Data Variables:
Yes

Name

Function:
The name of an item, such as a property or attribute in a name/value pair.
Accepted Values:
One line of text (a string) with no spaces.
Default Value:
None

Value

Function:
The value for an item, such as the value for a process data variable in a key-value pair.
Accepted Values:
A valid object value.
Default Value:
None

Show All Fields

Function:
Specifies if all the name/value fields show.
Accepted Values:
  • Selected - All the name/value fields show.
  • Deselected - All the name/value fields do not show.
Default Value:
Deselected

Configure Lookup > Grouping tab

Groups SharePoint list data by a specified column name, either in ascending or descending order

Figure: Grouping tab

Grouping tab

Fields

Field NameDefinition

Site URL

Function:
Specifies the URL for your SharePoint site.
Accepted Values:
A valid SharePoint site URL.
Default Value:
None
Accepts Process Data Variables:
Yes
Example:

Configuration Mode

Function:
Specifies how to configure the WHERE clause for the lookup.
Accepted Values:
  • Quick Configuration - Lets you quickly create a WHERE clause to configure the lookup.
  • Advanced - Lets you manually create a WHERE clause to configure the lookup.

    You can select Advanced if you select Multiple Columns in the Lookup Details screen. When you select Advanced, only the CAML Query, Test Query, and Error Messages tabs are available for configuration.

Default Value:
Quick Configuration

Group By - Columns

Function:
Specifies the name of the SharePoint column to group the SharePoint records to get the required result set.
Accepted Values:
The name of your SharePoint list column.
Default Value:
None
Accepts Process Data Variables:
No

Order By - Columns

Function:
Specifies the name of the SharePoint column that organizes the CAML query result set.
Accepted Values:
The name of your SharePoint list column.
Default Value:
None
Accepts Process Data Variables:
No

Sort By

Function:
Specifies the sort order for the result set.
Accepted Values:
  • Ascending
  • Descending
Default Value:
Ascending

Configure Lookup > Query Options tab

Specifies how and where CAML query operations are performed in the SharePoint list.

Figure: Query Options tab

Query Options tab

Fields

Field NameDefinition

Site URL

Function:
Specifies the URL for your SharePoint site.
Accepted Values:
A valid SharePoint site URL.
Default Value:
None
Accepts Process Data Variables:
Yes
Example:

Configuration Mode

Function:
Specifies how to configure the WHERE clause for the lookup.
Accepted Values:
  • Quick Configuration - Lets you quickly create a WHERE clause to configure the lookup.
  • Advanced - Lets you manually create a WHERE clause to configure the lookup.

    You can select Advanced if you select Multiple Columns in the Lookup Details screen. When you select Advanced, only the CAML Query, Test Query, and Error Messages tabs are available for configuration.

Default Value:
Quick Configuration

Row Limit

Function:
Specifies the maximum number of rows to get with the CAML query.
Accepted Values:
  • Deselected - Specifies to get 10,000 maximum from the CAML query.
  • Selected - Gets the specified number of records.
Default Value:
Deselected

Show Required Columns

Function:
Specifies that mandatory columns are in the CAML query results.
Accepted Values:
  • Selected - The mandatory columns are in the CAML query results.
  • Deselected - The mandatory columns are not in the CAML query results.
Default Value:
Deselected

Specify A Folder

Function:
Specifies the location of a folder in which to execute the CAML query.
Accepted Values:
  • Selected - The activity runs the CAML query at the folder location.
    • Look in all folders and subfolders - The CAML query is run in all the folders and their subfolders.
    • Specify a folder - The CAML query is run only in the specified folder.
  • Deselected - The activity runs the CAML query in the entire SharePoint database.
Default Value:
Selected
Accepts Process Data Variables:
No

Configure Lookup > CAML Query tab

Shows the code snippet that is generated from the WHERE clause.

Figure: CAML Query tab

CAML Query tab

Fields

Field NameDefinition

Site URL

Function:
Specifies the URL for your SharePoint site.
Accepted Values:
A valid SharePoint site URL.
Default Value:
None
Accepts Process Data Variables:
Yes
Example:

Configuration Mode

Function:
Specifies how to configure the WHERE clause for the lookup.
Accepted Values:
  • Quick Configuration - Lets you quickly create a WHERE clause to configure the lookup.
  • Advanced - Lets you manually create a WHERE clause to configure the lookup.

    You can select Advanced if you select Multiple Columns in the Lookup Details screen. When you select Advanced, only the CAML Query, Test Query, and Error Messages tabs are available for configuration.

Default Value:
Quick Configuration

CAML Query - Code Snippet

Function:
Shows the code snippet the system creates for the CAML WHERE clause.
Accepted Values:
  • Read Only - If you select Quick Configuration.
  • A valid SQL WHERE clause - If you select Advanced.
Default Value:
None

Configure Lookup > Test Query tab

Makes sure the specified CAML query is correct.

Figure: Test Query tab

Test Query tab

Fields

Field NameDefinition

Site URL

Function:
Specifies the URL for your SharePoint site.
Accepted Values:
A valid SharePoint site URL.
Default Value:
None
Accepts Process Data Variables:
Yes
Example:

Configuration Mode

Function:
Specifies how to configure the WHERE clause for the lookup.
Accepted Values:
  • Quick Configuration - Lets you quickly create a WHERE clause to configure the lookup.
  • Advanced - Lets you manually create a WHERE clause to configure the lookup.

    You can select Advanced if you select Multiple Columns in the Lookup Details screen. When you select Advanced, only the CAML Query, Test Query, and Error Messages tabs are available for configuration.

Default Value:
Quick Configuration

Validate Query

Function:
Does a test to make sure the query is correct, and displays the error message if an error occurs.

If the query completes, it shows View Formatted Data and View Raw Data options. When you click View Formatted Data, the result shows in a table. If you click View Raw Data, the result shows in XML format.

Test Query

Function:
Shows the result of the CAML query in a table or XML format.

Configure Columns

Opens this Screen:
Configure Lookup > Configure Columns
To Open this Field:
  1. On the Configuration Mode field, select Advanced.
Function:
Configures a data type for more than one column to show in your lookup.
Limitations:

This field is available in these releases:

Configure Lookup > Configure Columns

Configures a data type for more than one column to show in your lookup.

Figure: Configure Lookup > Configure Columns

Configure Columns

Prerequisites

Fields

Field NameDefinition

Display Name

Function:
Specifies the name for the column that shows in your lookup.
Accepted Values:
One line of text that can have spaces.
Default Value:
Different for different columns

Data Type

Function:
Specifies the data type for the column.
Accepted Values:
A data type from the list.
Default Value:
None

Format

Function:
Specifies the date format that the column shows.
To Open this Field:
  1. In the Data Type field, select Date.
Accepted Values:
  • MM/dd/yyyy - Shows the date in the format Month/day/year.
  • yyyy/MM/dd - Shows the date in the format year/Month/day.
  • yyyy-MM-dd - Shows the date in the format year-Month-day.
  • dd-MM-yyyy - Shows the date in the format day-Month-year.
  • dd MMM yyyy - Shows the date in the format day Month year.
  • MMM dd yyyy - Shows the date in the format Month day year.
Default Value:
None
Example:
  • 09/21/1978
  • 1978/09/21

Format

Function:
Specifies the date-time format that the column shows.
To Open this Field:
  1. In the Data Type field, select DateTime.
Accepted Values:
  • MM/dd/yyyy - Shows the date in the format Month/day/year.
  • MM/dd/yyyy HH:mm:ss - Shows the date-time in the format Month/day/year hour:minute:second.
  • yyyy/MM/dd - Shows the date in the format year/Month/day.
  • yyyy-MM-dd HH:mm:ss - Shows the date-time in the format year-Month-day hour:minute:second.
  • yyyy-MM-dd - Shows the date in the format year-Month-day.
  • dd-MM-yyyy - Shows the date in the format day-Month-year.
  • dd-MM-yyyy HH:mm:ss - Shows the date-time in the format day-Month-year hour:minute:second.
  • dd MMM yyyy - Shows the date in the format day Month year.
  • dd MMM yyyy HH:mm:ss - Shows the date-time in the format day Month year hour:minute:second.
  • MMM dd yyyy - Shows the date in the format Month day year.
  • MMM dd yyyy HH:mm:ss - Shows the date-time in the format Month day year hour:minute:second.
Default Value:
None
Example:
  • 09/21/1978 18:35:50

Collapse All

Function:
Specifies whether to close the Display Name and Data Type fields for all columns on the screen.
Accepted Values:
  • On - Closes the Display Name and Data Type fields for all columns.
  • Off - By default, the Display Name and Data Type fields stay open for all columns.
Default Value:
Deselected

Reset

Function:
Restores the default display name and data type for the column.

Configure Lookup > Error Messages tab

Configures the message to show if the lookup does not return any data..

Figure: Configure Lookup > Error Messages tab

Error Messages tab

Fields

Field NameDefinition

No Items Retrieved

Function:
Specifies the error message to show if the lookup does not return any data.
Accepted Values:
One line of text that can have spaces.
Default Value:
None

Lookup Failed

Function:
Specifies the message to show if the data fails to load.
Accepted Values:
More than one line of text.
Default Value:
Failed to load data.