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

Description:
Specifies the type of SharePoint lookup to create.
Allowed 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

Description:
Specifies the access token that connects to your data source.
Allowed Values:
A list of access tokens configured for your environment.
Default Value:
None
Accepts 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

Description:
Specifies the name you want to give to your lookup procedure.
Allowed Values:
One line of text (a string).

Accepted:

  • Letters
  • Numbers
  • Spaces
Default Value:
None
Accepts Variables:
No
Example:
Refer to:

Lookup Type

Description:
Specifies the type of lookup procedure to do.
Allowed 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

Description:
Specifies the URL for your SharePoint site.
Allowed Values:
A valid SharePoint site URL.
Default Value:
None
Accepts Variables:
Yes
Example:

Configuration Mode

Description:
Specifies how to configure the WHERE clause for the lookup.
Allowed 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

Description:
Specifies the name of your SharePoint list.
Allowed 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 Variables:
Yes

Name

Description:
The name of an item, such as a property or attribute in a name/value pair.
Allowed Values:
One line of text (a string).

Not Accepted:

  • Spaces
Default Value:
None

Value

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

Show All Fields

Description:
Specifies if all the name/value fields show.
Allowed 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

Description:
Specifies the URL for your SharePoint site.
Allowed Values:
A valid SharePoint site URL.
Default Value:
None
Accepts Variables:
Yes
Example:

Configuration Mode

Description:
Specifies how to configure the WHERE clause for the lookup.
Allowed 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

Description:
Specifies the name of your SharePoint list.
Allowed 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 Variables:
Yes

Name

Description:
The name of an item, such as a property or attribute in a name/value pair.
Allowed Values:
One line of text (a string).

Not Accepted:

  • Spaces
Default Value:
None

Value

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

Show All Fields

Description:
Specifies if all the name/value fields show.
Allowed 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

Description:
Specifies the URL for your SharePoint site.
Allowed Values:
A valid SharePoint site URL.
Default Value:
None
Accepts Variables:
Yes
Example:

Configuration Mode

Description:
Specifies how to configure the WHERE clause for the lookup.
Allowed 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

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

Order By - Columns

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

Sort By

Description:
Specifies the sort order for the result set.
Allowed 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

Description:
Specifies the URL for your SharePoint site.
Allowed Values:
A valid SharePoint site URL.
Default Value:
None
Accepts Variables:
Yes
Example:

Configuration Mode

Description:
Specifies how to configure the WHERE clause for the lookup.
Allowed 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

Description:
Specifies the maximum number of rows to get with the CAML query.
Allowed 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

Description:
Specifies that mandatory columns are in the CAML query results.
Allowed 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

Description:
Specifies the location of a folder in which to execute the CAML query.
Allowed 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 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

Description:
Specifies the URL for your SharePoint site.
Allowed Values:
A valid SharePoint site URL.
Default Value:
None
Accepts Variables:
Yes
Example:

Configuration Mode

Description:
Specifies how to configure the WHERE clause for the lookup.
Allowed 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

Description:
Shows the code snippet the system creates for the CAML WHERE clause.
Allowed 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

Description:
Specifies the URL for your SharePoint site.
Allowed Values:
A valid SharePoint site URL.
Default Value:
None
Accepts Variables:
Yes
Example:

Configuration Mode

Description:
Specifies how to configure the WHERE clause for the lookup.
Allowed 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

Description:
Specifies the name for the column that shows in your lookup.
Allowed Values:
One line of text (a string).

Accepted:

  • Letters
  • Numbers
  • Spaces
Default Value:
Different for different columns

Data Type

Description:
Specifies the data type for the column.
Allowed Values:
A data type from the list.
Default Value:
None

Format

Description:
Specifies the date format that the column shows.
To Open this Field:
  1. In the Data Type field, select Date.
Allowed 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

Description:
Specifies the date-time format that the column shows.
To Open this Field:
  1. In the Data Type field, select DateTime.
Allowed 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

Description:
Specifies whether to close the Display Name and Data Type fields for all columns on the screen.
Allowed 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

Description:
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

Description:
Specifies the error message to show if the lookup does not return any data.
Allowed Values:
One line of text (a string).

Accepted:

  • Letters
  • Numbers
  • Spaces
Default Value:
None

Lookup Failed

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