Nintex

BrightWork Tip: Create a Project with Nintex Workflow and BrightWork Web Service

December 8, 2017 by

The BrightWork web service is now extended to include the new endpoint, Create Project so that you can use Nintex Workflow to provision new Project Sites.

This allows the user to create projects based on parameters passed in by the user (using JSON) and this service will be called from the parent web.

  • https://samplesite/Sites/BWSite/Projects/_vti_bin/BrightWork.svc/CreateProject
    • Will create a new top-level project in BWSite.
  • https://samplesite/Sites/BWSite/Projects/ProjectA/_vti_bin/BrightWork.svc/CreateProject 
    • Will create a new subproject under Project A.

 

The Nintex workflow can be used with the existing Project Request Manager Template but ensure you disable the native BrightWork feature to create a Project from a Request. The workflow could also be employed in a standard SharePoint Custom List. This blog will step through the process of building the Nintex Workflow.

 

Create Project Nintex Workflow

Step 1 – Define your Variables

The Nintex Workflow needs seven variables defined, three of which are needed for the Web Service Call and four that are needed to create the Project:

VariableType
PostResultSingle line of text
PostResultMultipleTextMultiple lines of text
XMLExtractSingle line of text
ProjectNameSingle line of text
TemplateNameSingle line of text
ProjectDescriptionMultiple lines of text
ProjectManagerPerson or Group

 

Nintex Workflow Variables

Step 2 – Set your Variables

In Nintex, use the standard Set Variable Action to capture information from the Project Request Form that will be passed to the Project Site.

Set Variable Set Variable 1

 

Nintex Set Variable Form

 

Step 3 – Build and execute the Web request

Building and executing the Web request requires three actions:

Nintex Web Request

Step 3a – Capture XML containing X-RequestDigest

Create a Web Request Action to capture the X-RequestDigest and store the information in the PostResultMultipleText variable

X-RequestDigest

URL:

https://samplesite/Sites/BWSite/Projects/prm/_api/contextinfo

Content Type:

application/x-www-form-urlencoded

Store Results:

PostResultMultipleText

Step 3b – Extract X-RequestDigest from XML

Create a Query XML Action to parse out the X-RequestValue from the XML captured in the previous action and store the information in the XMLExtract Variable.

Extract X-RequestDigest

XML from Variable:

{WorkflowVariable:PostResultMultipleText}

Output using Xpath:

//*[local-name()=’FormDigestValue’]

Store Results:

XMLExtract

Step 3c – Create Project Site from X-RequestValue

The final step is to create the Project Site using the X-Request Digest and populating the Project with your pre-defined variables:

Create Project Site from X-RequestValue BrightWork Web Service

URL:

https://samplesite/Sites/BWSite/Projects/_vti_bin/BrightWork.svc/CreateProject

Content Type:

application/json

Header Information:

{

“templateName”:”{WorkflowVariable:TemplateName}”,

“projectName”:”{WorkflowVariable:ProjectName}”,

“projectTitle”:”{WorkflowVariable:ProjectName}”,

“projectDescription”:”{WorkflowVariable:ProjectDescription}”,

“useParentTopNavigation”:”True”,

“addToParentTopNavigation”:”True”,

“addToParentQuickLaunch”:”True”

}

 

 

Image credit 

Peter Doyle

Project Management Consultant, BrightWork
Peter Doyle

Latest posts by Peter Doyle (see all)

    Pin It on Pinterest

    Share This