Reference

Endpoint Read List Items


Name

get_list_items

Description

No description available

Related Tables

[Dynamic Table] , ListItems

Parameters

Parameter Required Options
Name: ListId

Label: ListId

Specify a list id to search items for
YES
Name: SiteId

Label: SiteId (Re-Select ListId after you change this)

Specify a site
Name: Filter

Label: Filter

To filter data on a field, you will first need to index it: https://support.microsoft.com/en-us/office/add-an-index-to-a-list-or-library-column-f3f00554-b7dc-44d1-a2ed-d477eac463b0
Option Value
None
Equal Search fields/SomeColumn eq 'SomeValue'
Substring Search substringof(fields/SomeField,'abc')
Starts With startswith(fields/SomeField, 'abc')
Name: MetaDetectionOrder

Label: Metadata Mode (Change if columns missing or NULL) **SLOW**

Only change if expected columns are missing (e.g. SLA or nested custom fields). Default uses predefined columns (fast). MergeStaticDynamic scans sample data to infer types and merge with static metadata—slower but exposes nested/document columns; use META='@OverrideMode:1' in SQL to add specific dynamic fields.
Option Value
Default Default
Static Static
MergeStaticDynamic MergeStaticDynamic
Name: expand

Label: Expand (Output Fields)

By default lookup fields are returned as (null). Select fields which you want to process (to speedup processing check only those fields which are (null) in the output)

Output Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
Id DT_WSTR nvarchar(200) 200
CreatedOn DT_DBTIMESTAMP datetime
CreatedById DT_GUID uniqueidentifier
CreatedByDisplayName DT_WSTR nvarchar(200) 200
ModifiedOn DT_DBTIMESTAMP datetime
LastModifiedId DT_GUID uniqueidentifier
LastModifiedDisplayName DT_WSTR nvarchar(200) 200
[Dynamic Column] DT_WSTR nvarchar(2000) 2000 [Dynamic Column]
[Dynamic Column]LookupId DT_I4 int [Dynamic Column] LookupId
[Dynamic Column]LookupIdArray DT_WSTR nvarchar(2000) 2000 Array of [Dynamic Column] LookupId
[Dynamic Column]LookupIdOdataType DT_WSTR nvarchar(25) 25 OData Type for [Dynamic Column] required to map in INSERT/UPDATE Operation for Multi Select fields
[Dynamic Column]Label DT_WSTR nvarchar(500) 500 [Dynamic Column] Id
[Dynamic Column]TermGuid DT_WSTR nvarchar(100) 100 Managed Meta [Dynamic Column] TermGuid
[Dynamic Column]WssId DT_I4 int Managed Meta [Dynamic Column] WssId
If the column you are looking for is missing, consider customizing SharePoint Online Connector.

Input Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime.

Examples

SSIS

Use SharePoint Online Connector in API Source or in API Destination SSIS Data Flow components to read or write data.

API Source

This Endpoint belongs to the [Dynamic Table] table, therefore it is better to use it, instead of accessing the endpoint directly:

API Source - SharePoint Online
Read and write SharePoint Online data effortlessly. Integrate, manage, and automate sites, lists, document libraries, and files — almost no coding required.
SharePoint Online
[Dynamic Table]
Required Parameters
ListId Fill-in the parameter...
Optional Parameters
SiteId (Re-Select ListId after you change this)
Filter
SSIS API Source - Read from table or endpoint

API Destination

This Endpoint belongs to the [Dynamic Table] table, therefore it is better to use it, instead of accessing the endpoint directly. Use this table and table-operation pair to read list items:

API Destination - SharePoint Online
Read and write SharePoint Online data effortlessly. Integrate, manage, and automate sites, lists, document libraries, and files — almost no coding required.
SharePoint Online
[Dynamic Table]
Select
Required Parameters
ListId Fill-in the parameter...
Optional Parameters
SiteId (Re-Select ListId after you change this)
Filter
SSIS API Destination - Access table operation

ODBC application

Use these SQL queries in your ODBC application data source:

Read items from a list

<p>Reads list items from any SharePoint list when you supply <code>ListId</code>. For a document library, each item corresponds to a file or folder row. Turn on metadata detection below if you need extra or hidden fields (e.g. Link field in Lists, Content Type Id, etc. which are not included by default in the standard endpoint).</p>

SELECT * FROM get_list_items
WITH (
	  ListId='14bdfd1d-1090-4cfe-adc1-XXXXXXXXXXXXXX'
	 -- Turn on Metadata Detection to get additional fields (e.g. Link to item, Content Type Id, etc.) that are not included by default in the standard endpoint. This is especially useful for document libraries.
	 --,MetaDetectionOrder='MergeStaticDynamic' 
	)
--Obtain ListId from the Lists table or list_lists (e.g. SELECT id, name FROM Lists).

Get list items

<p>Gets items from a specific list. Replace <code>MyList</code> with the actual name of your SharePoint list.</p>

SELECT * FROM MyList 
--WHERE Id = 1234

Get list items with filter

<p>Gets items from a list using a filter. This mimics a SharePoint view. Use <code>HonorNonIndexedQueriesWarningMayFailRandomly</code> in <code>ExtraHeaders</code> if filtering on non-indexed fields.</p>

SELECT * FROM MyList 
WITH(Filter='MyField eq ''Something'' ')
--In order to search on non-indexed fields set following value for ExtraHeaders property on connection UI
--Prefer: HonorNonIndexedQueriesWarningMayFailRandomly

Get ListItems

SELECT * FROM ListItems

get_list_items endpoint belongs to [Dynamic Table] , ListItems table(s), and can therefore be used via those table(s).

SQL Server

Use these SQL queries in SQL Server after you create a data source in Data Gateway:

Read items from a list

<p>Reads list items from any SharePoint list when you supply <code>ListId</code>. For a document library, each item corresponds to a file or folder row. Turn on metadata detection below if you need extra or hidden fields (e.g. Link field in Lists, Content Type Id, etc. which are not included by default in the standard endpoint).</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM get_list_items
WITH (
	  ListId=''14bdfd1d-1090-4cfe-adc1-XXXXXXXXXXXXXX''
	 -- Turn on Metadata Detection to get additional fields (e.g. Link to item, Content Type Id, etc.) that are not included by default in the standard endpoint. This is especially useful for document libraries.
	 --,MetaDetectionOrder=''MergeStaticDynamic'' 
	)
--Obtain ListId from the Lists table or list_lists (e.g. SELECT id, name FROM Lists).';

EXEC (@MyQuery) AT [LS_TO_SHAREPOINT_ONLINE_IN_GATEWAY];

Get list items

<p>Gets items from a specific list. Replace <code>MyList</code> with the actual name of your SharePoint list.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM MyList 
--WHERE Id = 1234';

EXEC (@MyQuery) AT [LS_TO_SHAREPOINT_ONLINE_IN_GATEWAY];

Get list items with filter

<p>Gets items from a list using a filter. This mimics a SharePoint view. Use <code>HonorNonIndexedQueriesWarningMayFailRandomly</code> in <code>ExtraHeaders</code> if filtering on non-indexed fields.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM MyList 
WITH(Filter=''MyField eq ''''Something'''' '')
--In order to search on non-indexed fields set following value for ExtraHeaders property on connection UI
--Prefer: HonorNonIndexedQueriesWarningMayFailRandomly';

EXEC (@MyQuery) AT [LS_TO_SHAREPOINT_ONLINE_IN_GATEWAY];

Get ListItems

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM ListItems';

EXEC (@MyQuery) AT [LS_TO_SHAREPOINT_ONLINE_IN_GATEWAY];

get_list_items endpoint belongs to [Dynamic Table] , ListItems table(s), and can therefore be used via those table(s).