Endpoint Update List Item
Name
update_list_item
Description
Related Tables
Parameters
| Parameter | Required | Options |
|---|---|---|
|
Name:
Label: ListId (Re-Enter ListItemId after you change this) Specify a list id to search items for |
YES | |
|
Name:
Label: ListItemId Specify a list item id |
YES | |
|
Name:
Label: SiteId (Re-Select ListId after you change this) Specify a site |
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] |
Input Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description |
|---|---|---|---|---|
| Id |
DT_WSTR
|
nvarchar(200)
|
200 | |
| [Dynamic Column] |
DT_WSTR
|
nvarchar(2000)
|
2000 | [Dynamic Column] |
| [Dynamic Column]OdataType |
DT_WSTR
|
nvarchar(100)
|
100 | You may never need to map this field, map only when your metadata is not indexed or you need to give hint for SPO Write operation incase you got 400 Bad request. Possible values can be Collection(Edm.String), Collection(Edm.Int32), ... |
| [Dynamic Column]LookupId |
DT_I4
|
int
|
[Dynamic Column] Id | |
| [Dynamic Column]LookupIdOdataType |
DT_WSTR
|
nvarchar(100)
|
100 | You may never need to map this field, map only when your metadata is not indexed or you need to give hint for SPO Write operation incase you got 400 Bad request. Possible value is Collection(Edm.Int32) |
Examples
SSIS
Use SharePoint Online Connector in API Source or in API Destination SSIS Data Flow components to read or write data.
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 update list item:
| Required Parameters | |
|---|---|
| ListId (Re-Enter ListItemId after you change this) | Fill-in the parameter... |
| ListItemId | Fill-in the parameter... |
| Optional Parameters | |
| SiteId (Re-Select ListId after you change this) | |
| Writer Date Time Format (Treat as Local or UTC) | yyyy-MM-ddTHH:mm:ss.fffZ |
ODBC application
Use these SQL queries in your ODBC application data source:
Update a document library item
<p>Updates metadata for an item in a document library list.</p>
UPDATE update_list_item
SET Title = 'My super title', OrderId = 12345
WITH (
ListId='14bdfd1d-1090-4cfe-adc1-XXXXXXXXXXXXX'
,ListItemId='775'
,Output=1
)
--You can get ListId by selecting from 'list_lists' endpoint.
--ListItemId can be retrieved by selecting from 'get_list_items' endpoint.
Update a list item
<p>Updates an existing list item by ID.</p>
UPDATE MyList
SET Name = 'Elizabeth', Surname = 'Johnson'
WHERE Id = '123'
Update a list item with multi-select fields
<p>Updates multi-select Lookup or Person/Group fields on an existing item.</p>
UPDATE MyList
SET Title = 'Elizabeth Johnson',
--Method#1 (Pass type info in the same value)
ManyPersonsLookupId = '[11,22,33]', "fields.ManyPersonsLookupId@odata\u002Etype" = 'Collection(Edm.Int32)'
--Method#2 (Pass type info via ODataField)
--OR--
--ManyPersonsLookupId = '[11,22,33]',
--ManyPersonsLookupIdODataType" = 'Collection(Edm.Int32)
WHERE Id = '123'
update_list_item 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:
Update a document library item
<p>Updates metadata for an item in a document library list.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE update_list_item
SET Title = ''My super title'', OrderId = 12345
WITH (
ListId=''14bdfd1d-1090-4cfe-adc1-XXXXXXXXXXXXX''
,ListItemId=''775''
,Output=1
)
--You can get ListId by selecting from ''list_lists'' endpoint.
--ListItemId can be retrieved by selecting from ''get_list_items'' endpoint.';
EXEC (@MyQuery) AT [LS_TO_SHAREPOINT_ONLINE_IN_GATEWAY];
Update a list item
<p>Updates an existing list item by ID.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE MyList
SET Name = ''Elizabeth'', Surname = ''Johnson''
WHERE Id = ''123''';
EXEC (@MyQuery) AT [LS_TO_SHAREPOINT_ONLINE_IN_GATEWAY];
Update a list item with multi-select fields
<p>Updates multi-select Lookup or Person/Group fields on an existing item.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE MyList
SET Title = ''Elizabeth Johnson'',
--Method#1 (Pass type info in the same value)
ManyPersonsLookupId = ''[11,22,33]'', "fields.ManyPersonsLookupId@odata\u002Etype" = ''Collection(Edm.Int32)''
--Method#2 (Pass type info via ODataField)
--OR--
--ManyPersonsLookupId = ''[11,22,33]'',
--ManyPersonsLookupIdODataType" = ''Collection(Edm.Int32)
WHERE Id = ''123''';
EXEC (@MyQuery) AT [LS_TO_SHAREPOINT_ONLINE_IN_GATEWAY];
update_list_item endpoint belongs to
[Dynamic Table]
, ListItems
table(s), and can therefore be used via those table(s).