Crear Item en Lista de SharePoint usando CSOM

A través de una aplicación de consola podemos crear items en una lista utilizando la librería cliente de SharePoint:

string siteUrl = "";

using (ClientContext clientContext = new ClientContext(siteUrl))
    SecureString passWord = new SecureString();
    foreach (char c in "myPassword".ToCharArray()) passWord.AppendChar(c);
    clientContext.Credentials = new SharePointOnlineCredentials("", passWord);

    List oList = clientContext.Web.Lists.GetByTitle("myList");

    ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();
    ListItem oListItem = oList.AddItem(itemCreateInfo);
    oListItem["Title"] = "Item Title";


No Responses

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.