I have a query regarding SharePoint Office 365.

  1. I have a form of any technology like php, asp.net, python
  2. Three fields are there Name, Lastname and display name and submit button.
  3. I have office online 365 account in which I have created site and created one custom list with same fields Name,lastname and dsiplay name.

What I want is that when a user fills the form and click on submit button, data should be entered in custom list.

Input can be from any technology like php, asp.net.

How can I accomplish this in Office 365?

3 Answers 3


you can do with the client context object in your .net application by adding reference of Microsoft.SharePoint.Client and Microsoft.SharePoint.Client.Runtime;

i have done with console application by following code

string login = "office 365 username";
        string password = "office 365 password";
        var securePassword = new SecureString();
        foreach (char c in password)
        //Authenticate to office 365
        var onlineCredentials = new SharePointOnlineCredentials(login, securePassword);

        using (ClientContext clientContext = new ClientContext("office 365 url"))
            clientContext.Credentials = onlineCredentials;
            Web web = clientContext.Web;

            // You can do operation with client context object


Plz refer this link for insert, update, delete with client context object http://msdn.microsoft.com/en-us/library/ee539976.aspx

Hope it helps...

  • Please help with webservice, list.asmx because input can be from any technology also not decided machine should have sharepoint
    – Richa Jain
    May 15, 2014 at 13:15

You can update list on sharepoint online using Client side object model.

using(ClientContext clientContext = new ClientContext(siteUrl))
 clientContext.Credentials = new SharePointOnlineCredentials(userName,password);
                SP.List oList = clientContext.Web.Lists.GetByTitle("Announcements");
                ListItem oListItem = oList.Items.GetById(3);

                oListItem["Title"] = "My Updated Title.";


  • Yes, I am updating the answer with some code sample. Thanks for your help.
    – Aanchal
    May 15, 2014 at 11:23
  • Please give me some useful links or code. It would be more helpful.
    – Richa Jain
    May 15, 2014 at 11:24
  • Are you sure this code will run in asp.net form, I mean client context.
    – Richa Jain
    May 15, 2014 at 11:35
  • Yes, it will. This is client object model. This will run from all machines from where sharepoint is accessible.
    – Aanchal
    May 15, 2014 at 12:14
  • Please help with webservice, list.asmx becuase input can be from any technology also not decided machine should have sharepoint
    – Richa Jain
    May 15, 2014 at 13:14

Here is an alternative to user2861804's answer, using JSOM instead of CSOM:

function createListItem(siteUrl) {
    var clientContext = new SP.ClientContext(siteUrl);
    var oList = clientContext.get_web().get_lists().getByTitle('Announcements');

    var itemCreateInfo = new SP.ListItemCreationInformation();
    this.oListItem = oList.addItem(itemCreateInfo);
    oListItem.set_item('Title', 'My New Item!');
    oListItem.set_item('Body', 'Hello World!');

        Function.createDelegate(this, this.onQuerySucceeded), 
        Function.createDelegate(this, this.onQueryFailed)

function onQuerySucceeded() {
    alert('Item created: ' + oListItem.get_id());

function onQueryFailed(sender, args) {
    alert('Request failed. ' + args.get_message() + 
        '\n' + args.get_stackTrace());

getByTitle() uses the display name, not the internal name, and vice versa for set_item().

  • Please help with webservice, list.asmx becuase input can be from any technology also not decided machine should have sharepoint
    – Richa Jain
    May 15, 2014 at 13:14
  • Just to clarify, the aspx file is not in SharePoint, but rather hosted elsewhere, which may or may not reside on the SharePoint server?
    – wjervis
    May 15, 2014 at 13:23
  • yes you are right, but above code will ask for sharepoint reference and not necessary it would be asp.net form it can be of php form too, python form too
    – Richa Jain
    May 15, 2014 at 13:26
  • Well, C# would be the approach to go with an asp.net form. See answers from user2861804 and Hitesh for more information. You'll have to include the Microsoft.SharePoint.Client.dll files in your solution. As for PHP, I've no experience with PHP, so I'm of no use to you. As for the list.asmx, I have insufficient experience to be of real help. Here's a link that may be of help: msdn.microsoft.com/en-us/library/….
    – wjervis
    May 15, 2014 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.