SharePoint - Remove List Item

Declaration

<AMSHAREPOINT ACTIVITY="remove_listitem" LIST="text" ID="number" PROVIDER="text (options)" />

See Also

SharePoint - Move File | SharePoint - Remove from Role | SharePoint - Remove User from Group | SharePoint - Rename Folder | SharePoint - Update List | SharePoint - Update List Item | SharePoint - Update Role | SharePoint - Update Site | SharePoint - Upload File

Description

Removes an item from an existing list on a SharePoint Services site. Lists usually appear in a multi-column/multi-row table of information which are basic buildings blocks of Web pages on a Windows SharePoint Services site.

IMPORTANT: The SharePoint activities are performed using SharePoint Client Object Model/Web Services. Therefore, you must have SharePoint Server 2003/2007/2010 installed in order for these activities to work. Additionally, certain activities or parameters are only supported in SharePoint Server 2010. Support details are highlighted in the properties of relevant activities.

Practical Usage

A Microsoft Windows SharePoint Services site can include a variety of lists — from contacts and calendars to announcements and issue-tracking lists. This activity is commonly used to remove items from such lists. To add a list item, use the Add List Item activity.

Parameters

List Item Properties

Property

Type

Required

Default

Markup

Description

List Title

Text

Yes

(Empty)

LIST="Calendar"

The displayed title for the list. Click the Go button to populate this field with all available list titles. Thereafter, select the desired list title from the drop-down.

Filter by

Text (options)

No

Query

Name="columnName"

The filter criteria to use. The available options are:

  • Query - Filtering is via CAML Query.

  • ID - Filtering is via list item ID.

CAML Query

Text

No

(Empty)

LIBRARY="TEXT"

The CAML Query specifying the item to remove. This parameter is available only if the Filter by parameter is set to Query.

NOTE: This option is only supported in SharePoint 2010.

List item ID(s)

Text

No

(Empty)

ID="123456"

A string value for the ID of the list item to remove. This parameter is available only if the Filter by parameter is set to ID.

 

Server Properties

These properties allow you to create a custom session for this activity or link this activity to an existing session.

Property

Type

Required

Default

Markup

Description

Provide Settings

Text (options)

Yes

Custom

PROVIDER="session_based"

Indicates where this activity's server credentials should originate from. Different parameters become active  depending on the option selected. The available options are:

  • Custom (default) - Specifies that a custom set of credentials will be entered for this  activity. This option is normally selected when automating a single SharePoint activity.

  • Session Based - Specifies that credentials should derive from a session created in a previous Create Session step. This allows several activities to be linked to a specific session, eliminating redundancy. Multiple sessions can exist within a single task allowing several SharePoint operations to be automated simultaneously.

Session

Text

No

SharePointSession1

SESSION="mySession1"

The name of the session to associate this activity with. The default value is SharePointSession1. This parameter is active only if the Provide Settings parameter is set to Session Based.

NOTE: Use the End Session activity to end an active SharePoint session.

Version

Text (options)

Yes

SharePoint 2010

VERSION="SharePoint2010"

The SharePoint version to associate with this session. This parameter is active only if the Provide Settings parameter is set to Custom. The available options are:

  • SharePoint 2010 (default)

  • SharePoint 2007 and older

IMPORTANT: Certain SharePoint activities or parameters are only supported in SharePoint 2010. Support details are highlighted in the properties of relevant activities.    

Site

Text

Yes

(Empty)

SITE="http://myServer/tech"

The SharePoint site to associate with this session. This parameter only accepts entry of a top level site. Specification of a subsite (if applicable) can be entered in the properties of individual SharePoint activities. This parameter is active only if the Provide Settings parameter is set to Custom.

Authentication Type

Text (options)

No

Default

AUTHTYPE="Form"

The method of authentication to use. Certain parameters become active depending on which authentication method is selected. The available options vary depending on the SharePoint version.

 SharePoint 2010 available authentication types:

  • Default (default)

  • Basic

  • Form

  • Anonymous

SharePoint 2007 and older available authentication types:

  • Basic

  • Digest

  • Proprietary

  • None

  • NTLM (default)

This parameter is active only if the Provide Settings parameter is set to Custom.

Username

Text

Yes

(Empty)

USERNAME="theUserName"

A valid SharePoint username. This parameter may or may not be active depending on which option is selected under the Authentication Type parameter.

Password

Text

Yes

(Empty)

PASSWORD="encryptedText"

A valid  SharePoint password. This parameter may or may not be active depending on which option is selected under the Authentication Type parameter.

Domain

Text

Yes

(Empty)

DOMAIN="myServer"

The domain that the username (specified in the Username parameter) belongs to. This parameter may or may not be active depending on which option is selected under the Authentication Type parameter.

Certificate

Text

No

(Empty)

CERTIFICATE="C:\Temp\file.cer"

The (DER encoded) certificate to use for SharePoint authentication. This parameter may or may not be active depending on which option is selected under the Authentication Type parameter.

Ignore invalid certificate

Yes/No

No

No

IGNOREINVALIDCERTIFICATE="yes"

If set to YES, specifies that invalid server certificates that are detected will be automatically ignored. Set to NO by default. This parameter is active only if the Certificate parameter is set to YES.

Timeout (seconds)

Number

No

600

TIMEOUT="500"

The total number of seconds allowed to connect to the SharePoint server, otherwise a time out error is generated. The default value is 600 seconds. This parameter is active only if Provide Settings parameter is set to Custom.

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties allows you to instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables and Functions

All text fields allow the use of expressions such as variables, functions or AutoMate extended functions, which can be entered by surrounding the expression in percentage signs (example: %FileDateTime(myVar)% or %myVar%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on function

More on extended functions
More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Description: Remove item(s) from sharepoint list "books". Session is "SharePointSession1".

 

<AMSHAREPOINT ACTIVITY="remove_listitem" LIST="books" ID="123456" PROVIDER="session_based" />

 

↑ Top of Page