Tuesday 19 November 2013

Have a REST with SharePoint Designer 2013 Workflow

SharePoint Designer 2013 provides a new set of actions including, finally, the ability to call REST services – sadly I find this feature truly exiting. It even works on SharePoint Online (within limits).

The brief example below will add a row to the MyBikes list. The status entries, log entries and emails can all be ignored.

The rest call will be an HTTP POST to the following method: https://<web>/sites/intranet/_api/web/lists/getbytitle('MyBikes')/items

Ensure that you check the REST URL first to ensure it is correct, running it through Fiddler and checking the JSON is very useful.

  1. Fire up SharePoint Designer.
  2. Create a site workflow.
  3. Create the Dictionary for the Header, the Metadata and the Parameters (see below).

image
Figure 0 – The workflow.

image
Figure 1 – The header contains the Accept and Content-Type definitions set to application/json;odata=verbose.

image
Figure 2 – The metadata indicated the list specific call. Worth checking this with Fiddler.

image
Figure 3 – The parameters binds to the metadata and defined the columns to be updated.

image
Figure 4 – Construct the REST call, binding the parameters, and the header (via properties).

image

Publish. Navigate to Site Content and manually execute - Heh presto a new row is added to the list.

Tuesday 12 November 2013

SharePoint Online, InfoPath and the World of Tomorrow …


I have read a number of articles on the above topic, some good and some not so good. I will try and clear up some of the confusion:

What is Microsoft InfoPath?
Microsoft InfoPath 2013 is part of the current Microsoft Office Product set. It provides the ability to create, codeless, integrated enterprise forms within the InfoPath Filler client, within Outlook and on the web via InfoPath Form Services (part of the SharePoint 2013 Enterprise CAL).

Will InfoPath be in Office v Next?

To date Microsoft have not made any public announcements regarding the next version of Office. The official line from Microsoft is that "InfoPath is currently in the product".

Does SharePoint 2013 support InfoPath?
Yes.

The SharePoint 2013 on-premise experience is good with a number of enhancements over SharePoint 2010. The SharePoint Online experience is very limited.

Can I connect to SharePoint Web Services from InfoPath Forms within SharePoint Online ?

Not currently.

Loopback protection is enabled on the SharePoint Online environment and will block calls to SOAP and REST from InfoPath Form Services. http://support.microsoft.com/kb/2674193
What about external web service calls?

These are blocked by the Cross Site Domain Access security rule which is not currently configurable within the SharePoint Online Control Panel.

Should I use InfoPath 2013 ?
This question gets asked a lot and my answer is “maybe”.

If you are developing for SharePoint 2010 or upgrading to SharePoint 2013 on-premise then “Yes” if the solution fits.

Many ‘experts’ state that InfoPath should not be used on SharePoint 2013. As I understand it the message Microsoft is promoting is that if possible all new solutions should not contain server based user code e.g. No custom web parts, no event receivers, no SharePoint Web Services. The future is client side coding with JavaScript and CSOM, Web Apps and Azure.

It’s clear that the server based InfoPath Form Services component does not fit into this model - but a client side variant would…