2

What are my options for getting data from a form hosted on our wordpress site into a sharepoint list?

1

I think the simplest way would be to setup Incoming Email in SharePoint, and then send you data by email. Don't forget to add captcha field to you wordpress-based form in order to filter out the inevitable spam.

Another option would be, for example, a custom web service, that would receive the data and put it into the list using CSOM.

4

Another option would be to consume SharePoint REST service for that purpose using JavaScript or PHP in WordPress site

If PHP is allowed in your WordPress site, then you could utilize SharePoint client for PHP that allows to performs CRUD operations on SharePoint data using an SharePoint 2013 REST/OData based API.

Scenario

Assume a custom Contacts form developed in WordPress site. And it is required to save contacts info in SharePoint Online Contacts list during form submit.

Then the following code snippet demonstrates how to save contacts info on form submit:

if ($_POST['submitted']) {
    saveContact();
} 

function saveContact(){

    $url = "https://contoso.sharepoint.com/";
    $username = "username@tcontoso@microsoft.com";
    $password = "password" 
    $client = new SPOClient($url);
    $client->signIn($username,$password);

    $list = $client->getList('Contacts');
    $contactEntry = buildContactEntry();    //collect properties from form  
    $item = $list->addItem($contactEntry);
    print "Contact '{$item->Title}' has been created successfully.\r\n";
}

References

  • 1
    +1! Thanks for sharing, very interesting library! I think this solution is definitely "the way to go" for SPO, since SPO doesn't support Incoming Emails anyways; while Incoming Emails will be the right approach for on-premise SharePoint. – Andrey Markeev Aug 27 '14 at 2:59
  • Actually you can send messages to SharePoint using third party tools like Workflow Actions Pack (plumsail.com/workflow-actions-pack/docs). Review this article for details plumsail.com/blog/2013/12/…. I'm developer of this product. – Anton Khritonenkov Mar 25 '16 at 16:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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