SharePoint - Add List Item

 

Declaration

<AMSHAREPOINT ACTIVITY="add_listitem" LIST="text (options)" SITE="text" AUTHTYPE="text (options)" USERNAME="text" PASSWORD="text (encrypted)" DOMAIN="text" IGNOREINVALIDCERTIFICATE="yes/no" CERTIFICATE="text" TIMEOUT="number" PROXYTYPE="text (options)" PROXYSERVER="text" PROXYPORT="number" PROXYUSERNAME="text" PROXYPASSWORD="text (encrypted)"><SharePointCellData Name="text" Value="text" /><SharePointCellData /></AMSHAREPOINT>

See Also

SharePoint - Get Attachments | SharePoint - Get Files | SharePoint - Get Folder(s) | SharePoint - Get Groups | SharePoint - Get List Items | SharePoint - Get Lists | SharePoint - Get Roles | SharePoint - Get Sites | SharePoint - Get Users | SharePoint - Move File | SharePoint - Remove from Role | SharePoint - Remove List Item

Description

Adds an item to 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. The columns represent lists and the rows represent items in those lists. If the specified list (column) does not exist, it will be created during runtime along with its associated value. If the column already exists, the specified value will be added to the next available row in that column.

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 add items to such lists. To create a new list, use the Create List activity.

Parameters

List Item Properties

Property

Type

Req'd

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.

Add List Item

To add a new item, click the Click here to add a new item link and enter a value for the Column and Value fields.

Column

Text

Yes

(Empty)

Name="columnName"

The column field type in which to add a value to.

Value

Text

Yes

(Empty)

Value="theValue"

The value to add under the specified list (column).

NOTE: If the Column field is of type Lookup and if you want to update or add a field of that type, the value needs to be in this format: id;#value

Server Properties

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

Property

Type

Req'd

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

SharePoint

Session1

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.

Proxy Properties

Property

Type

Req'd

Default

Markup

Description

Proxy Type

Text (options)

No

Default

PROXYTYPE="http"

The proxy type to use. The available options are:

  • Default (default parameter)

  • None

  • HTTP

Use Authentication

If enabled, specifies that proxy  authentication is required, enabling authentication-based parameters. This parameter is disabled by default and only available if the Proxy Type parameter is set to HTTP.

NOTE: This is a design time parameter and therefore does not contain any markup.

Proxy Server

Text

No

(Empty)

PROXYSERVER="proxy.host.com"

The host name (server.domain.com) or IP address (xxx.xxx.xxx.xxx) of the proxy server. This parameter is available only if the Proxy Type parameter is set to HTTP.

Proxy Username

Text

No

(Empty)

PROXYUSERNAME=username

The proxy username to authenticate with. This parameter is available only if the Use Authentication parameter is enabled.

Proxy Password

Text

No

(Empty)

PROXYPASSWORD="encrypted"

The proxy password to authenticate with. This parameter is available only if the Use Authentication parameter is enabled.

Proxy Port

Number

No

808

PROXYPORT="8080"

The port that should be used to connect to the proxy server. The default port is 808. This parameter is available only if the Proxy Type parameter is set to HTTP.

 

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: Add an item to sharepoint list "myList". Session is "SharePointSession1".

 

<AMSHAREPOINT ACTIVITY="add_listitem" LIST="myList" PROVIDER="session_based"><SharePointCellData Name="Contacts" Value="David" /></AMSHAREPOINT>

 

↑ Top of Page