Showing posts with label Workflow. Show all posts
Showing posts with label Workflow. Show all posts

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.

Thursday, 8 September 2011

SharePoint Designer 2007 Workflow – Configuring the default Task List

When creating a workflow within SharePoint Designer you will note that unlike the out of the box workflows it does not prompt you for the default tasks list.
To configure the Task list:
  1. Navigate to the task list you wish to use, select Settings, List Settings; Right click on Audience targeting settings or Information management policy settings and select Properties. Copy the list GUID from the address URL e.g. {b8b415e2-89fa-40cb-a598-85eec0cd6271}
  2. Navigate to the Workflow folder in SharePoint Designer and expand it
  3. Double click on the <workflow name>.xoml.wfconfig.xml file, locate the Association TaskListID and replace with default GUID with the new task list GUID from step 1.
  4. Save and republish the workflow
For more information on SharePoint Designer 2007 workflows see the Microsoft site.

Example of wfconfig.xml file:

<WorkflowConfig>
    <Template
        BaseID="{99CCD0B6-D5BC-46E4-A6C7-3054C2157FCE}"
        DocLibID="{6FA134EA-846D-46BD-8F2A-246D103A5A01}"
        XomlHref="Workflows/Test Workflow/Test Workflow.xoml"
        XomlVersion="V7.0"
    >
    </Template>
    <Association
        ListID="{FB7C61AA-3F15-4914-A965-C6F24ED2FD7F}"
        TaskListID="{b8b415e2-89fa-40cb-a598-85eec0cd6271}"
        StartManually="true"
    >
    </Association>
    <ContentTypes>
    </ContentTypes>
    <Initiation URL="Workflows/Test Workflow/Test Workflow.aspx">
        <Fields/>
        <Parameters></Parameters>
    </Initiation>
</WorkflowConfig>