Download - SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

Transcript
Page 1: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint SaturdaySponsorsGold

Silver

Bronze

Advanced InfoPath and Workflow Techniques

Kevin AnnfieldOBS

Page 2: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

Who am I

• Design and build advanced form and workflow solutions

• Also train, mentor, guide and consult on all facets of SharePoint 2010

Page 3: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

Session Overview

• InfoPath Form design tips• Use a REST Data Connection in InfoPath– Use a known but variable list of approvers

• Copy attachments from InfoPath to Document Set

• Nintex Workflow Task Approval in InfoPath form

Page 4: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

Session Overview

• Assumed knowledge of SharePoint 2010• Assumed knowledge of InfoPath and Nintex

Workflow• Not a 100 level session but also not an

advanced 300 level session, all NO CODE• This session based off a real form, for a real

multi national client.

Page 5: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

General Form Design

• Make it “wizard” based• Use views to split a form

into logical sections• Use rules to change views• Use same rules to query

data connections when required

Page 6: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

Why wizards

• Reduce initial form load time• Choose when to load data connections• Use logic to guide user through form• Show related information on different views

Page 7: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

Data Connections

• SharePoint Lists• Web Services– SOAP (userprofileservice.asmx)– REST (listdata.svc)

• SQL Server– Limited functionality– Use External List

Page 8: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

Approver List

• Solution uses a list to hold approvers for each Office and Department

• These approvers are in a specific order• There are also optional approvers in the

sequence

Page 9: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

REST Data Connections

• Use a URL to connect to a list• Filter, sort, lookup parameters• Used in this solution to show a filtered list of

approvers from a SP List– Multiple query fields– Query using “Less than or Equal to”. Not possible

with standard SOAP queries.

Page 10: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

REST Web Service

http://sp2010/sites/spsdemo/_vti_bin/listdata.svc/Approvers()?$filter=DelegationAmount le 250000 and OfficeNameTxt eq 'Brisbane' and DepartmentNameTxt eq 'Delivery'&$select=ApproverName,ApproverId,Role,DepartmentNameTxt,OfficeNameTxt,ApproverRequiredValue&$orderby=ApprovalOrder

• http://sp2010/sites/spsdemo - Site where the list is• /_vti_bin/listdata.svc – REST Web Service• ?$filter= - what filter values and types are used• eq, ne, gt, ge, lt, le, and, or etc

• &$select= - fields to include• &$orderby= - the order of the returned values

Page 11: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

Setup REST in InfoPath

• See blog post

• http://kevinannfield.wordpress.com

Page 12: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

BUILD A REST DATA CONNECTIONApproval Form Demo

Page 13: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

REST Web Service

Page 14: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

InfoPath Attachments - Problems

• Documents shouldn’t stay in a form• No collaboration, versioning, check out• Large files can slow a form down

Page 15: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

Attachments - Solution

• Copy documents into a Document Set• Link to documents from form• Remove documents from form

Page 16: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

Page 17: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

Copy Attachment to Document Set

• Query XML to see if document attached check box = TRUE• If attachment exists

– Copy to sharepoint • embedded document with xpath from form• save result url in variable

– Regex on result url to extract file name– Set field on form to show the link field on form.

• Rule on form to show this from the “Yes” value

– Encode url, space = %20– Update the URL field, add child node to url group repeating table

• <my:AttachmentUrlRptTbl>• <my:AttachmentUrl

my:AttachmentUrlTitle="{TitleOfDocument}">{UrlOfCopiedDocument}</my:AttachmentUrl>• </my:AttachmentUrlRptTbl>

– Remove attachment, clear checkbox so people can add another document• update XML to update attachment URL, Remove Attachment and clear checkbox

Page 18: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

COPY AND LINK ATTACHMENTSApproval Form Demo

Page 19: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

Nintex Task Approval in InfoPath

• Provides a single interface to complete a task• Allows a form designer to give more context

around task• Gives a much nicer user interface than the

standard Flexi Task response• Can provide more functionality, as per demo

Page 20: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

In form Task Approval

• Setup data connections in form– /_vti_bin/nintexworkflow/workflow.asmx

• GetRunningWorkflowTasksForCurrentUser• GetOutcomesForFlexiTask• ProcessFlexiTaskResponse2

• Setup Task Approval section and fields• Setup Flexi Task in workflow• Use the Nintex SDK available at Nintex Connect – http://

connect.nintex.com/files/folders/sdk_nw2010/default.aspx

Page 21: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

IN FORM TASK APPROVALApproval Form Demo

Page 22: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

QUESTION AND ANSWERAdvanced InfoPath and Nintex Workflow Techniques

Page 23: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday Brisbane 2012

Related Links

• http://connect.nintex.com

• http://kevinannfield.wordpress.com

• Feedback athttp://tinyurl.com/bnefeedback

Page 24: SPSBNE - Advanced InfoPath and Nintex Workflow Techniques

SharePoint Saturday

Thanks for listening!

Remember to submit your feedback so you can go into the raffle draw at the end of the day! And don’t forget that

you have to be at the draw to claim your prizes!

SponsorsGold

Silver

Bronze