Adding SharePoint Reusable Workflow to Content Type

One good reason to add a workflow to a Content Type instead of directly to the SharePoint List, is when using a Document Set Content Type. Say if Document Set Content Type had at least 3 documents, then if we want to configure the workflow to send email notification that when Document Set is created, if we were to create the workflow at the SharePoint List level, then at least 3 email notification will be sent out when Document Set is created (1 email for each document within the Document Set), however if we create the workflow at the Document Set Content Type level, then only 1 email will be sent when Document Set is created.

There might be many other reason’s why workflow is required at the Content Type level, then directly in the SharePoint List level.

One preferred way to create workflow at the content type level is to create a reusable workflow.

Depending on which Workflow tool you are using (SharePoint Designer Workflow, Nintex Workflow, K2 Workflow or AgilePoint Workflow), each way has it’s own steps of creating a reusable workflow. In this example, we will be using a simple Nintex Reusable Workflow.

Here are the steps involved:

1. Create a reusable workflow, in this example, by click on the circle icon, Nintex Workflow 2013, and then Create Reusable Workflow Template (for new Reusable Workflow).

1.CreateResuableWorkflowMenu

2. Give the workflow a Title (or Name), in this case we’ll call it, “My Reusable Workflow”.

2.GiveReusableWorkflowAName.png

3. And we’ll just add one Send notification action in this workflow.

3.AddReusableWorkflowSendNotificationAction.png

4. And then configure the Send notification action, and then click Save:

4.SendNotificationConfiguration.png

5. And then Publish the Workflow.

5.PublishTheReusableWorkflow.png

6. Now go to the Content Type in the Document Library, in this case we have a Document Set Content Type already created.

To find out how to create Document Set, please view the blog:

Create SharePoint 2013 Document Sets

7. Click on the content type

6.ClickOnDocumentSetContentType.png

8. Click on Workflow settings

7.ContentTypeWorkflowSettings.png

9. Click on Add a Workflow

8.AddAContentTypeWorkflow.png

10. In workflow section, select My Reusable Workflow, and in Start Options, check Creating a new item will start this workflow, and type in the name of the workflow, in this case “My First Reusable Workflow”, and then click OK.

8.SetWorkflowSettings.png

11. Now go back to document library, and add a new document set:

9.CreateANewDocumentSet.png

12. And give the document set a name, create the new document set.

10.GiveDocumentSetAName.png

13. And now the document set workflow has been executed, and an email has been sent.

11.DocumentSetWorkflowExecuted.png

Email:

12.EmailMessageDocSetCreated.png

 

 

Create SharePoint 2013 Document Sets

Here are the steps involved in creating a SharePoint Document Sets.

1. In SharePoint, go to Site Settings, and then Site content types.

1.SiteContentTypesLink

2. Create a new content type and give it a name. In this case we’ll call it, Fieldwork Form.

Also, in select the parent content type from, select: Document Content Types

and, in Parent Content Type, select: Document.

In groups, add to group: Custom Content Types.

2.AddFieldWorkContentType.png

And then click OK.

3. Once the content type is created, go to Advanced Settings, and upload a Document Template, and then click OK.

3.UploadFieldworkForm.png

4. Repeat Step 2 and 3, and create another content type with the same settings, and give it a name, Fieldwork Risk Assessment, and Fieldwork Medical Form.

4.DocumentContentTypeCreated.png

5. Then create a new content type, and give it a name, Fieldwork Document Set.

Also, in select the parent content type from, select: Document Set Content Types

and, in Parent Content Type, select: Document Set.

In groups, add to group: Custom Content Types.

5.AddFieldworkDocumentSetContentType.png

6. Once the document set is created, click on Document Set Settings

6.DocumentSetSettings.png

7. In this section for:

Allowed Content Types, select Custom Content Types

Select all the Fieldwork Content Types (that we created in steps 2 to 3).

In Default Content, add the Fieldwork Content Types (as shown below)

7.SetDocumentSetSettings.png

And then click OK.

 

8. Now create a document library called, Fieldwork Document, and go to Library Settings, and then click on Advanced Settings.

9. Make sure Allow management of content types is set to Yes, and then click OK.

8.AllowManagementOfContentTypesToYes.png

10. Click on Add from existing site content types.

9.AddFromExisitngSiteContentTypes.png

11. In section, Select site content types from, select: Custom Content Types

And select Fieldwork Document Set.

10.SelectFieldWorkDocumentSetContentType.png

12. Now go back to Fieldwork Document Library, click on Files (in the ribbon menu) and click on the drop down in New Document, and select Fieldwork Document Set.

11.CreateFieldWorkDocumentSet.png

13. Give the document set a name, in this case, Fieldwork Paris, and then click OK.

12.GiveDocumentSetAName.png

14. Now the document set has been created.

13.DocumentSetHasBeenCreated.png

 

 

 

Create a Nintex Workflow in SharePoint Online 365

Developing Nintex on-premises and developing Nintex Online 365 has some similarity and some differences.

For example, installation of Nintex Workflow and / or Nintex Forms is no longer required in SharePoint Online, as Nintex is now available as an app.

Assuming we have a SharePoint List called Staff Details, with at least 3 fields:

Field Name Data Type
FirstName Single line of text
LastName Single line of text
FullName Single line of text

1.StaffDetailsSharePointList

The steps involved in creating a Nintex Workflow in SharePoint Online 365 are:

1. Click on Site contents

2.SiteContent.png

2. Click on New, and then select App.

3.NewAppMenu

3. click on SharePoint Store

4.SharePointStoreMenu

4. Search for Nintex, and then click on Nintex Workflow for Office 365, and add the app to the SharePoint site. This might take a while to add the app.

5.NintexWorkflow365App.png

5. Go back to the SharePoint List, Staff Details, and you should see Nintex Workflow link. Click on Nintex Workflow.

8.SeeTheNintexWorkflowLink.png

6. You will get a dialog box appearing about the trial version, just click on GO TO THE DESIGNER

9.GoToTheDesigner

7. And click on New list workflow

10.NewListWorkflow.png

8. You will now see you design mode of Nintex Workflow.

11.NintexWorflowDesignMode.png

9. Select Insert Action, then Libraries and List, and then Update List Item

12.SelectUpdateListItem.png

10. Click on the Update List Item drop down menu, and select Configure

13.UpdateListItemConfigureMenu.png

11. For the options, in the:

Target List: Select Current Item

List Item Properties: Select FullName

then click Add.

14.SelectTargetListANDListItemProperties.png

12. From Item Properties, select FirstName and LastName

15.SelectFirstNameANDLastName

And your FullName field should look like the following:

16.FullNameField.png

13. Then click Save.

14. Click on Settings in the ribbon menu.

17.ClickOnNintexWorkflowSettings.png

15. And type in your workflow name, in this case, Staff Details Workflow, and then check, Start When items are created, and then click Save.

18.SetWorkflowSettings.png

16. Then click on Publish, and then Publish the Workflow.

19.ClickOnNintexWorkflowPublish.png

17. Go back to your Staff Details SharePoint List, and create a new item.

And type in all the details, except for FullName, and then click Save.

21.TypeInFirstNameANDLastName.png

18. And then you will notice the Nintex Workflow has updated the FullName.

22.WorkflowUpdatedFullName.png

 

 

Deploying InfoPath Forms to SharePoint Online 365

Deployment of InfoPath Forms in SharePoint Online 365 is somewhat similar to deploying on SharePoint on-premises, however with a few minor changes.

Here are the steps to deploy InfoPath on SharePoint Online 365:

1. In InfoPath Forms, open Blank Form.

1.InfoPathBlankForm.png

2. In the header of the form, type in Employee Details.

3. Then add a table. To start off with, add 2 rows, and 4 columns.

2.AddTable.png

4. In the field, right click myFields, and add two fields to start off with:

FirstName, and LastName.

3.AddFields.png

5. Add the fields to the form:

4.AddFieldsToForm.png

6. Then save the form by clicking on File in the ribbon, then Save, and give it an appropriate name, in this case:

EmloyeeDetails.xsn

5.SaveForm.png

7. Then click on File, then Publish, and then SharePoint Server.

6.PublishSharePointServer.png

8. Insert URL of your SharePoint Online 365 site.

7.InsertURLOfSharePointSite.png

Note: You might get a pop up message at this step saying:

The feature requires SharePoint Server 2010 or greater with InfoPath Forms Services enabled

Please refer to the blog below to resolve this issue:

The feature requires SharePoint Server 2010 or greater with InfoPath Forms Services enabled

9. Then it will prompt you to insert username and password, and then click on Sign in.

8.PromptToInsertPassword.png

10. Then select Form Library, and click Next.

8.SelectFormLibrary.png

11. Then select Create a new form library, and click next.

12. Then type in name of Form Library and click next, in this case:

Employee Details

9.TypeInNameOfFormLibrary.png

13. Keep on clicking next, until you see the Publish button.

10.PublishButton.png

14. And then click on Publish.

15. Then check Open this form library…, and then click close.

11.OpenThisFormLibrary.png

16. A browser will open in SharePoint Online 365 to the Employee Details Forms Library, click on New button.

12.ClickOnNewButton.png

17. Then the form should now be opened in SharePoint Online 365.

13.FormNowOpenedInSharePointOnline.png

 

 

 

Content Editor Web Part not showing in SharePoint Online 365

When first creating an account and logging into SharePoint Online 365, and when trying to add a web part to a web page, you will notice Content Editor Web Part is missing.

1.BeforeCEWP

Content Editor Web Part is one of the most highly used SharePoint web parts, so to not have a Content Editor Web Part enabled, means a partial crisis for SharePoint. However, not to fear, you can enable Content Editor Web Part in SharePoint Online.

Here are the steps involved:

1. Go to SharePoint admin center, and then click on Settings.

3.SettingsInSharePointAdminCenter.png

2. Enable custom scripts, by scroll down to Custom Scripts, and select:

Allow users to run custom script on personal sites

and, Allow users to run custom script on self-service created sites

4.CustomScriptsEnabled

and then click OK.

Note: This setting might take 24 hour to take effect.

3. Go back to your site, and now you should see Content Editor Web Part enabled.

5.AfterCEWPEnabled.png

 

 

Custom SharePoint List Online Forms and Workflows to choose from

In this year of 2017, SharePoint has come out with many flavours and approaches in the way of developing online approval forms, such as a “travel expense form”. From a history list of SharePoint versions, such as SharePoint 2007 all the way to SharePoint 2013 and SharePoint Online 365, the question arises when wanting to develop a Custom SharePoint Form, of what approaches or technologies is their available in the market and what approaches we can use to develop Custom SharePoint Forms. And the next question arises, which workflow tool to use in creating for example approvals in workflows?

Well some of the well known tools in the market for SharePoint Online Form development are:

Online Form Technologies Advantages / disadvantages
infopath_logo.png InfoPath Forms Advantage:

  • Quicker Development Time as generally no code is required (although you can still add code to InfoPath Forms)
  • Very powerful form with views, rules, and many controls
  • Able to link with web services, and SharePoint list data
  • Easy to learn, and software development coding background is not required (unless adding code)

Disadvantage:

  • Not able to attach large files, such as small video files
  • InfoPath is getting deprecated by Microsoft
  • Might experience issues with non-internet explorer browsers
VS2012Logo ASP.NET Web Parts Visual WebParts Advantage:

  • Visual Studio required
  • Allow CSS and JavaScript coding
  • Able to use most ASP.NET controls, with some SharePoint controls such as People Picker

Disadvantage:

  • Longer to develop as code is required, and therefore ASP.NET (preferably C#) coding knowledge background is required.
SPServices HTML, JQuery, and SPServices Advantage:

  • Able to debug directly in web browser, such as google chrome, internet explorer.
  • Provides strong functionalities with HTML controls.

Disadvantage:

  • Longer to develop as code is required, and therefore JavaScript coding knowledge background is required.
  • Not able to use in SharePoint 2007
  • Sometimes harder to debug as the code is in JavaScript and JQuery.
AngularJS_Short.png Angular JS, JQuery, with SharePoint Rest Service API Advantage:

  • Able to debug directly in web browser, such as google chrome, internet explorer.
  • Angular modifies the page DOM directly instead of adding inner HTML code.
  • Provides strong functionalities with HTML controls.

Disadvantage:

  • Longer to develop as code is required, and therefore Angular, JavaScript coding knowledge background is required.
  • Not able to use in SharePoint 2007
  • Sometimes harder to debug as the code is in JavaScript and JQuery.
PowerAppsLogo PowerApps In this year 2017, PowerApps is fairly new in the market for form development. PowerApps is highly being pushed by Microsoft in the cloud on SharePoint Online 365, and it is seen as an alternative to InfoPath forms development, as InfoPath is getting depreciated by Microsoft.

Advantage:

  • Already comes with the Office 365 Online products (with SharePoint Online, PowerApps, Flows, etc.).
  • No code required, and therefore no coding knowledge required.

Disadvantage:

  • New in the market.
 NintexForms

k2SmartForms.png

AgilePointLogo.jpg

3rd Party
Forms
There maybe many 3rd Party Forms out there, but the 3 main 3rd Party Forms for SharePoint that I have come across with are from:

Advantage:

  • All these forms comes with workflows.
  • Comes with some great feature. Each 3rd Party tool has it’s own features.

Disadvantage:

  • Cost money to purchase.
  • Some of these forms might not be as powerful as InfoPath Forms, but you never know in the future.

 

Now moving on to workflows, how do we decide which workflow tool to use with SharePoint?

Well, the most cheapest option, out there is:

1. SharePoint Designer Workflows

SharePoint Designer Workflows are a free Workflow tool that can be downloaded from the internet, however even though it’s free, it doesn’t provide a image look and feel of the Workflow once it’s deployed. Basically, to find out what steps have been completed, and what is the current step in the Workflow, you would have to do a lot of logging in the Workflow.

Below is the design view of SharePoint Designer Workflow:

SharePointDesignerWorkflow

 

2. Nintex Workflows (https://www.nintex.com/)

Nintex Workflows might be one of the most used Workflows tools out there in this time by alot of companies. Nintex Workflow provide a great graphical interface, and it is easy to use and develop.

NintexWorkflow2007.png

 

3. AgilePoint Workflows (http://agilepoint.com/)

AgilePoint Workflow are one of my favourites. Really complicated Workflows can be developed with AgilePoint. This is definitely one of the options considered when deciding to purchase a online Workflow tool.

Workflow4

 

4. K2 Workflows (https://www.k2.com/)

K2 Workflows are another great option to choose from, and comes with many features, including Lazy Approval. K2 Workflows are a real advantage with your work environment. The design interface of K2 Workflows can be browser based, hosted in SharePoint, Visio and Visual Studio.

K2Workflow

 

5. Flow Workflows

Flow is relatively new to the market, and is a Microsoft based Workflow. Flow is highly being pushed by Microsoft in the cloud on SharePoint Online 365.Flow goes well with PowerApps. It might be a good option with SharePoint Online 365, but currently SharePoint on-premises, other Workflow tools are more used.

FlowWorkflow.png

 

In conclusion, spend some good research time into what Custom SharePoint Online Forms and Workflows tool to choose from, as generally when a SharePoint Online Forms and Workflow tool is selected, then many projects will be developed using those tools.

 

The feature requires SharePoint Server 2010 or greater with InfoPath Forms Services enabled

With SharePoint Online 365, the first issue you might get with InfoPath forms is this error message below:

The feature requires SharePoint Server 2010 or greater with InfoPath Forms Services enabled:

SPOnline365InfoPathFormServicesNotEnabledMessage

To resolve this issue, you must have access to SharePoint admin center. Here are the steps involved:

1. In the Admin center, go to SharePoint admin center.

2. Select infopath menu.

3. Check “Allow users to browser-enable form templates“, and “Render form templates that are browser-enabled by users“, and then click OK.

2.CheckInfoPathBrowserEnabledFormTemplates.png

4. You will get prompted with the message below, but just ignore the message and click OK:

Office 365 will support InfoPath Forms Services through 2015, but Microsoft is in the process of retiring InfoPath-based technologies.

To learn more, please refer to http://aka.ms/ipfs

Do you still want to enable InfoPath Form Services

3.InfoPathDepreciationMessage.png

This message only means that Microsoft is eventually depreciating and will no longer support InfoPath Form Services in the future.

5. Go back to InfoPath Forms, and you should now be able to connect to the SharePoint Online 365 list (also known as apps), or create a new SharePoint list.

 

SharePoint Online 365 _spPageContextInfo

In SharePoint Online 365, the _spPageContextInfo has more properties compared to SharePoint 2013. To view the SharePoint 2013 _spPageContextInfo, please go to blog SharePoint 2013 Javascript _spPageContextInfo.

When coding in SharePoint using JavaScript, then _spPageContextInfo code comes really in handy. _spPageContextInfo is a code that contains information about the current context or details about the SharePoint site. Some of the main data able to retrieve from _spPageContextInfo include:

1d.SharePoint365_spPageContextInfoProperties.png

Property SP 2010 SP 2013 SP Online 365 Example Value
webServerRelativeUrl x x x /Test Site
webAbsoluteUrl x x /Test Site
viewId x GUID
listId x x x GUID
listPermsMask x Object with properties
High & Low
listUrl x /Test Site/Pages
listTitle x Pages
listBaseTemplate x 850
viewOnlyExperience
Enabled
x false
blockDownloads
ExperienceEnabled
x false
cdnPrefix x static.sharepointonline
.com/bld
siteAbsoluteUrl x x https://test.sharepoint.com
siteId x https://test.sharepoint.com
showNGSCDialog
ForSyncOnTS
x false
supportPoundStorePath x false
supportPoundStorePath x false
siteSubscriptionId x Guid
isSPO x true
farmLabel x AUS_3_Content
serverRequestPath x x /Site/Pages/MyForm.aspx
layoutsUrl x x _layouts/15
webId x Guid
webTitle x x TestSite
webTemplate x x 1
tenantAppVersion x x 0
isAppWeb x false
webLogoUrl x x _layouts/15/images/
siteicon.png
webLanguage x x x 1033
currentLanguage x x x 1033
currentUICultureName x x en-US
currentCultureName x x en-US
env (environment) x prod
nid x 443
fid x 17518
serverTime x 2017-03-22T00:
11:23.6006021Z
serverTime x x 12$$16.0.6316.1203
crossDomainPhotos
Enabled
x x true
openInClient x false
webUIVersion x x x 15
webPermMasks x x Object with properties
High & Low
pageListId x x x Guid
pageItemId x x x 1
pagePermsMask x Object with properties
High & Low
pagePersonalization
Scope
x x 1
userEmail x
userId x x x 10
userLoginName x admin@test.onmicrosoft.com
userDisplayName x (fullName)
isAnonymousGuestUser x false
isExternalGuestUser x false
systemUserKey x x i:0h.f|(sid)
alertsEnabled x x x true
siteServerRelativeUrl x x /
allowSilverlightPrompt x x x True
themeCacheToken x /TestSite::1:16.0.6316.1203
themedCssFolderUrl x null
themedImageFileNames x null
isSiteAdmin x true
ExpFeatures x (Array of Numbers)
eg. :[-1935701612,2018769739,
1964068928]
killSwitches x (look below)
(Many Guid with boolean value)
eg. {“6800C0DF-81BF-4446-9D60-2749595D1028”:true,
“417833A3-7AFB-4E80-92AF-193E0D64FE6F”:true}
CorrelationId x Guid
hasManageWeb
Permissions
x true
isNoScriptEnabled x true
groupId x null
groupHasHomepage x false
isWebWelcomePage x false
siteClassification x
hideSyncButtonOnODB x false
showNGSCDialog
ForSyncOnODB
x false
sitePagesEnabled x true
DesignPackageId x Guid eg. 00000000-0000-0000-0000-000000000000
groupType x null
groupColor x #da3b01
siteColor x #da3b01
navigationInfo x null
MenuData x (look below)
Array of menu items.
eg. {“SettingsData”:[
{“Id”:”SuiteMenu_zz8_MenuItemAddPage”,
“Text”:”Add a page”,
“Url”:”/TestSite/_layouts/15/CreateSitePage.aspx”},{“Id”:”SuiteMenu_zz5_MenuItemCreate”,
“Text”:”Add an app”,
“Url”:”/TestSite Site/_layouts/15/addanapp.aspx”}]}
RecycleBinItemCount x -1
PublishingFeatureOn x false
PreviewFeaturesEnabled x false
disableAppViews x false
disableFlows x false
serverRedirectedUrl x null
formDigestValue x (long string of numbers, date time)
maximumFileSize x 10240
formDigestTimeoutSeconds x 1800
canUserCreateMicrosoftForm x false
readOnlyState x null

SharePoint 2013 Javascript _spPageContextInfo

When coding in SharePoint using JavaScript, then _spPageContextInfo code comes really in handy. _spPageContextInfo is a code that contains information about the current context or details about the SharePoint site. Some of the main data able to retrieve from _spPageContextInfo:

  • Current Culture
  • Current Language
  • Layouts URL
  • SharePoint web page URL
  • SharePoint site or subsite URL
  • UserId of the person logged into SharePoint
  • SharePoint site title

Here is a image list of all properties within _spPageContextInfo:

1._spPageContextInfoProperties

2._spPageContextInfoProperties

2._spPageContextInfo Properties

 

SharePoint Angular and bootstrap Form – Part 2

Continuing on with one of my previous blogs, SharePoint Angular and bootstrap Form – Part 1, in this blog, we are going to focus on how to extract data with SharePoint Angular Rest Service and put that into Angular scope.

The steps involved in this process are:

1. Remember to add the Script reference in SharePoint mentioned with the previous blog.

4.ScriptAndLinkReference

2. Then add the following code below within the the angular controller:

1.AjaxGetUserDetails

The code is explained as below:

a)

var userid = _spPageContextInfo.userId;

The _spPageContextInfo.userId code get’s the userId of the the person logged in to SharePoint.

b)

var requestUriGetUserDetails = _spPageContextInfo.webAbsoluteUrl + "/_api/web/getuserbyid(" + userid + ")";

The _spPageContextInfo.webAbsoluteUrl get’s the URL at the site level of the current site:

So if the sharepoint in your URL is:

https://sharepointsite.com/projects/sciprojmgnt/Pages/MyFirstAngularForm.aspx,

then then the value of, _spPageContextInfo.webAbsoluteUrl , would be:

https://sharepointsite.com/projects/sciprojmgnt/

The second part of the code is:

“/_api/web/getuserbyid(” + userid + “)”;

This code calls the api getuserbyid, with the parameter of userId.

getuserbyid api contains good amount of details of the current user, such as:

user’s login name, full name (title), email address, etc.

3.getuserbyid api.png

c) the Jquery Ajax function code is executed, with a success function called:

onSuccessGetUserDetails

and function method:

onErrorGetUserDetails

The onSuccessGetUserDetails function get’s the value from  getuserbyid api, and then stores then to the angular scope variables:

 var varFullName = data.d.Title;
 var varEmail = data.d.Email;
 var varLoginName = data.d.LoginName;

 $scope.loginName = varLoginName;
 $scope.email = varEmail;
 $scope.requestorEmail = varEmail;
 $scope.requestorFullName = varFullName;

 var fullNameArray = varFullName.split(" ");

 var firstNameValue = fullNameArray[0];
 var lastNameValue = fullNameArray[1];

 $scope.firstName = firstNameValue;
 $scope.lastName = lastNameValue;

 

3. When the code is inserted, then save the code, and then upload the form again to the SharePoint site, most likely in the Site Assets document library:

9.SharePointUploadHTMLFile

4. And then the form shows the value of the current details below:

4.SharePointAPIAngularJSForm