SharePoint 2013 – REST, JSON and SharePoint Designer

32
SharePoint 2013 – REST, JSON and SharePoint Designer Jaap Mollema

description

Jaap Mollema. SharePoint 2013 – REST, JSON and SharePoint Designer. Jaap Mollema SharePoint Consultant Microsoft Services [email protected] http://nl.linkedin.com/in/jaapmollema /. Vandaag. Acties & Workflow Interop REST Endpoints REST in SharePoint Designer Workflows - PowerPoint PPT Presentation

Transcript of SharePoint 2013 – REST, JSON and SharePoint Designer

Page 1: SharePoint 2013 – REST, JSON and SharePoint Designer

SharePoint 2013 – REST, JSON and SharePoint Designer

Jaap Mollema

Page 2: SharePoint 2013 – REST, JSON and SharePoint Designer
Page 3: SharePoint 2013 – REST, JSON and SharePoint Designer

Jaap MollemaSharePoint ConsultantMicrosoft [email protected]://nl.linkedin.com/in/jaapmollema/

Page 4: SharePoint 2013 – REST, JSON and SharePoint Designer

Vandaag• Acties & Workflow Interop• REST Endpoints• REST in SharePoint Designer Workflows• Verder dan een site

Page 5: SharePoint 2013 – REST, JSON and SharePoint Designer

Acties beschikbaar in 2013To much text?

Action DescriptionAssign a Task Assigns a single workflow task to a user or group.Start a Task Process Initiates execution of a task process.Go to This Stage Specifies the next stage in a workflow to which flow control should be handed.

Call HTTP Web Service Functions as a method call to a Representational State Transfer (REST) endpoint.Start a List Workflow Starts a list-scoped workflow.Start a Site Workflow Starts a site-scoped workflow.Build DynamicValue Creates a new variable of type DynamicValue.

Get Property from DynamicValue Retrieves a property value from a specified variable of type DynamicValue.Count Items in DynamicValue Returns the number of rows in a variable of type DynamicValue.Trim String Removes all leading and trailing white-space characters from the current string.

Find Substring in String Returns 1-based index of the first occurrence of one or more characters, or the first occurrence of a string, within a string.

Replace Substring in String Returns a new string in which all occurrences of a specified character or string are replaced with another specified character or string.

Translate DocumentFunctions as a wrapper around the HTTP activity that calls the synchronous translation API. You must configure a Machine Translation Service Application for the SharePoint site on which you run the workflow.

Set Workflow Status Updates workflow status as specified in message string.Create a Project from Current Item [Microsoft Project] Creates a Project Server project based on the current item.Set the current project stage status to this value [Microsoft Project] Sets the two status fields within the current stage of the project.Set the status field in the idea list item to this value [Microsoft Project] Updates the status field of the original SharePoint list item.

Wait for Project Event [Microsoft Project] Pauses the current instance of the workflow to await a specified Project event: Project checked in, Project committed, Project submitted.

Set this field in the project to this value [Microsoft Project] Sets the value for the enterprise custom field for a specified project.

Page 6: SharePoint 2013 – REST, JSON and SharePoint Designer

Acties niet beschikbaar in 2013There’s more

Action DescriptionAdd List Item Permissions This action is initially displayed in workflow steps as Add these permissions to item in list.

Assign a Form to a GroupThis action is initially displayed in a workflow step as Assign a custom form to these users. It enables you to create a custom task form with customized fields.

Assign a To-do Item This action is initially displayed in a workflow step as Assign to-do to these users

Capture a version of the Document SetIt locks the version of the document set that has the version of documents —major or minor— that you specify in the action.

Collect Data from a UserUse this action to assign a task to the participant, prompting them to provide the needed information in a custom task form, and then click the Complete Task button on the task form.

Copy List Item Use this action to copy a list item to another list.

Declare RecordUse this action to identify a document as a record and apply the record restrictions settings you may have defined in the Record Declaration Settings page on your SharePoint site.

Inherit List Item Parent PermissionsIf your item has unique permissions, you can use this action to make the item inherit the parent permissions from the list.

Lookup Manager of a User Use this action to look up a user's manager. The output value is then stored in a variable.

Remove List Item Permissions It removes permissions from an item for specific users.

Replace List Item PermissionsIt replaces an item's current permissions with the new permissions that you specify in the action.

Send Document Set to Repositoryallows you to move or copy the document set to a document repository.

Set Content Approval Status Use this action to set content approval of a document to Approved, Rejected, or Pending.

Set Content Approval Status for the Document Set

Use this action to set content approval of a document set to Approved, Rejected, or Pending.

Set Workflow Status Use this action to set the status of the workflowStart Approval Process It starts an approval action on a document to specific users.

Start Custom Task ProcessThe Start Custom Task Process action is an approval process template that you can use if the above approval actions do not meet your needs.

Start Document Set Approval Process It starts an approval action on a document set to specific users.

Start Feedback Process Use this action to assign task items for feedback to users in a specific order—serial or parallel.

Undeclare Record

Page 7: SharePoint 2013 – REST, JSON and SharePoint Designer

Workflow Interop

Page 8: SharePoint 2013 – REST, JSON and SharePoint Designer

Workflow Interop

Page 9: SharePoint 2013 – REST, JSON and SharePoint Designer

Workflow Interop

Page 10: SharePoint 2013 – REST, JSON and SharePoint Designer

REST

Page 11: SharePoint 2013 – REST, JSON and SharePoint Designer

REST Site- _api/web/ Lijsten of bibliotheken- _api/web/lists/- _api/web/lists/getByTitle(‘[LIST NAME’)- _api/web/lists/guid’[GUID ID]’)

Search- _api/search/query (retrieve results)- _api/search/postquery (POST, no URI length restricitions)- _api/search/suggest (query suggestions)

User Profiles- _api/SP.UserProfiles.PeopleManager

Page 12: SharePoint 2013 – REST, JSON and SharePoint Designer

RESTDESC!!

!

Page 13: SharePoint 2013 – REST, JSON and SharePoint Designer

REST

Page 14: SharePoint 2013 – REST, JSON and SharePoint Designer

REST

Page 15: SharePoint 2013 – REST, JSON and SharePoint Designer

SharePoint Designer

Page 16: SharePoint 2013 – REST, JSON and SharePoint Designer

REST• In SharePoint Designer:

− GET (ophalen resultaten)− POST (wegschrijven resultaten) & MERGE als onderdeel in de header− PUT (vervangen data)− DELETE (verwijderen data)

Page 17: SharePoint 2013 – REST, JSON and SharePoint Designer

Case• Offerte reviewers

• Afhankelijk van offertebedrag moeten bepaalde personen het document goedkeuren.

• SharePoint Library: Proposals• SharePoint Lijst: Routing Table

Page 18: SharePoint 2013 – REST, JSON and SharePoint Designer

Call• Stap 1: Ophalen Lijst:

• /_api/web/lists/GetByTitle('Routing%20Table')/items

• Stap 2: Beperken tot bedragen lager dan het offerte bedrag• /_api/web/lists/GetByTitle('Routing%20Table')/items?$filter=(Amount lt '5000')

• Stap 3: Hoogste bedrag bovenaan• /_api/web/lists/GetByTitle('Routing%20Table')/items?$orderby=Amount desc&$filter=(Amount lt '5000')

Page 19: SharePoint 2013 – REST, JSON and SharePoint Designer

Headers• Nodig:

•Method: GET• Request: _api/web/lists/GetByTitle('Routing%20Table')/ items?$orderby=Amount desc&$filter=(Amount lt '5000')• Accept: application/json;odata=verbose• Content-Type: application/json;odata=verbose

• Niet nodig• Authorization

Page 20: SharePoint 2013 – REST, JSON and SharePoint Designer

DEMO

Page 21: SharePoint 2013 – REST, JSON and SharePoint Designer

Wegschrijven data

Page 22: SharePoint 2013 – REST, JSON and SharePoint Designer

List Type• List Item Entity Type Full Name

• _api/web/lists/getbytitle('Resources')?$select=ListItemEntityTypeFullName

Page 23: SharePoint 2013 – REST, JSON and SharePoint Designer

Headers• Nodig:

•Method: POST• Request: _api/web/lists/GetByTitle(‘Update Feed')/ items• Accept: application/json;odata=verbose• Content-Type: application/json;odata=verbose• __metadata

• Niet nodig• Authorization

Page 24: SharePoint 2013 – REST, JSON and SharePoint Designer

DEMO

Page 25: SharePoint 2013 – REST, JSON and SharePoint Designer

Wegschrijven data in andere site

Page 26: SharePoint 2013 – REST, JSON and SharePoint Designer

App Permissions• Locatie van de workflow:

• _layouts/15/appprincipals.aspx?Scope=Web•Workflow:i:0i.t|ms.sp.ext|8208be62-6ae6-4ccc-894c-14d8d9b9fbeb@37153b50-af42-4e1a-97e5-da30ae7efa80 

• Locatie van de lijst• _layouts/15/oauthauthorize.aspx?client_id=8208be62-6ae6-4ccc-894c-14d8d9b9fbeb&response_type=code&scope=Search.QueryAsUserIgnoreAppPrincipal• Read of Write of Manage of Full Controll•Web.Read Site.Read List.Read

Page 27: SharePoint 2013 – REST, JSON and SharePoint Designer

DEMO

Page 28: SharePoint 2013 – REST, JSON and SharePoint Designer

Tips

Page 29: SharePoint 2013 – REST, JSON and SharePoint Designer

Tips- Begin altijd binnen de context van een

(sub)site (web)- Maak gebruik van een TEMP lijst voor

JSON response- Test call in je browser- Bewaar je workflow als template en

enable hem op verschillende subsites middels solutions

Page 30: SharePoint 2013 – REST, JSON and SharePoint Designer

Links- How to: Complete basic operations using SharePoint

2013 REST endpoints:- http://msdn.microsoft.com/en-us/library/jj164022.aspx

- Search REST API:- http://blogs.msdn.com/b/nadeemis/archive/2012/08/24/

sharepoint-2013-search-rest-api.aspx- Get Started with the SharePoint 2013 REST Service:

- http://msdn.microsoft.com/en-us/library/fp142380.aspx- Programming using the SharePoint 2013 REST

service:- http://msdn.microsoft.com/en-us/library/fp142385.aspx

- Understanding the SharePoint REST API:- http://msdn.microsoft.com/en-us/magazine/dn198245.aspx

Page 31: SharePoint 2013 – REST, JSON and SharePoint Designer

THANK YOU

Page 32: SharePoint 2013 – REST, JSON and SharePoint Designer