Thursday, September 25, 2014

SharePoint Online [Office 365] - Enable Anonymous users to Add items to list

I was recently implementing on SharePoint Online, which is a very good escape for content and publishing portals and Internet facing sites for Small & Medium enterprises which cannot afford the SharePoint Server licensing, with two alternative plans starting from 4$/month which is affordable for such business types.

We’ll have a series of articles of some challenges faced during the implementation to spread this knowledge, Specially that the term SaaS “Software as a Service” is trending and Microsoft is pushing towards Apps, cloud and for sure devices J.

The first Site Collections you have after registering for an Office 365 plan in SharePoint, SharePoint Public Site [Publishing Site], Team Site and search center with so many and many service applications configured and ready to go.

Mostly we will have interest for the SharePoint Public Site, as this is the site type that you can go online with, and enable anonymous users to access it, But in SharePoint online enabling anonymous access is just a button “Make this site online” J, You do not have the ability to set the anonymous access policy as you can do on SharePoint Server version, Even you cannot grant [Add Items], Even if you tried using SPO PS “SharePoint Online Power Shell”.

So a simple task like “Contact Us” form, creating a list with a form enabling users to add some data to the list would look like it is impossible. Then here comes the power of Apps J.

In SharePoint online the first thing you do before implementing any customization, have this Question “Is there an App for that??!” for most common tasks you will find an app for what you want to implement, Do not invest effort even time reinventing the wheel J.

Let’s get back on rails, What if the data we want to collect is a custom data, let’s get introduced to “Office 365 Anonymous Access / SharePoint 2013 Sandbox Solution” it is a Sandbox solution to manage anonymous access on Office 365 / SharePoint 2013.

OK. This is simple, Get the wsp, upload it to solution gallery then ……….. No , There is no solution gallery link under Site Settings J, Microsoft is hiding the link , But they did not prevent access to the page , So navigate to your Gallery by “ https://yourOffice365Domain-public.sharepoint.com/_catalogs/solutions/Forms/AllItems.aspx “ and yup you will be able to Upload the solution and activate it.

Note:  By default you will find this message “Your resource quota is 0 server resources. Solutions can consume resources and may be temporarily disabled if your resource usage exceeds your quota. “ message, So you need to allocate some server resources to the Public Site to be able to execute your packages:
  1. Go to the SharePoint Administration Panel
  2. Then select your public site collection, and select Server Resource Quota.
  3. Then assign some quota to the site collection
After activating the sandboxed solution, Navigate to your list and in the List tab, click on Anonymous Access

Then select Allow anonymous users to add items to this list

Now you can develop a form using SharePoint Apps, or Sandboxed solution to add the data to the list and anonymous users will be able to submit the data.

Note: I’ve tried to Using ECMA script for the form but it was not working with anonymous users, after having a call with Microsoft Support Engineer I was informed that is not allowed by Design !! , I am still investigating for it J



No comments:

Post a Comment