Skip to main content
jP_web_icon

jPoint Docs

Go Search
Home
jPoint Docs
Examples
Blog
  
jPoint > jPoint Docs > API > jP.Lists.List.addItem()  

jP.Lists.List.addItem()

jP.Lists.List.addItem()

Method

jP.Lists.List.addItem( data )

Overview

This method adds a new SPList item.

Arguments

Name
Type
Optional
Desctiption
data
JSON
false
example:data to modified JSON object [{ title:'title122', user:'user122'}, { id:0, title:'title123', user:'user123'}, {id:5, title:'title124', user:'user124'}]
note: name example 'title' is case sensitive and is internal field name of the sharepoint list column.
Three examples are given. The first does not include the 'id' property. This will cause the addItem() method to create a new item based on this object's data.
 
The second has an 'id' of 0. This will also cause the addItem() method to create a new item for this object's data.
 
The third has an 'id' of 5. If addItem attempts to add an item with an id greater that 0, it will do an update instead of an add. addItem() is an alias to updateItem() which determines whether the request is an update or an add.

Returns

operation result
{ success: (bool) whether the operation is success
   errorCode: error code, 0x00000000 for no error
   errorText: error text, null for no error
   id: item id, -1 for error
}

Last modified at 3/2/2010 10:37 PM  by Michael Wills