SPSBNE - Advanced InfoPath and Nintex Workflow Techniques
1. Sponsors SharePoint Saturday
Gold
Advanced InfoPath and
Workflow Techniques
Silver
Bronze Kevin Annfield
OBS
2. Who am I
• Design and build advanced form and
workflow solutions
• Also train, mentor, guide and consult on all
facets of SharePoint 2010
SharePoint Saturday
Brisbane 2012
3. 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
SharePoint Saturday
Brisbane 2012
4. 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.
SharePoint Saturday
Brisbane 2012
5. 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
SharePoint Saturday
Brisbane 2012
6. 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
SharePoint Saturday
Brisbane 2012
7. Data Connections
• SharePoint Lists
• Web Services
– SOAP (userprofileservice.asmx)
– REST (listdata.svc)
• SQL Server
– Limited functionality
– Use External List
SharePoint Saturday
Brisbane 2012
8. 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
SharePoint Saturday
Brisbane 2012
9. 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.
SharePoint Saturday
Brisbane 2012
10. REST Web Service
• 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
http://sp2010/sites/spsdemo/_vti_bin/listdata.svc/Approvers()?$filter=De
legationAmount le 250000 and OfficeNameTxt eq 'Brisbane' and
DepartmentNameTxt eq
'Delivery'&$select=ApproverName,ApproverId,Role,DepartmentNameTxt,
OfficeNameTxt,ApproverRequiredValue&$orderby=ApprovalOrder
SharePoint Saturday
Brisbane 2012
11. Setup REST in InfoPath
• See blog post
• http://kevinannfield.wordpress.com
SharePoint Saturday
Brisbane 2012
14. InfoPath Attachments - Problems
• Documents shouldn’t stay in a form
• No collaboration, versioning, check out
• Large files can slow a form down
SharePoint Saturday
Brisbane 2012
15. Attachments - Solution
• Copy documents into a Document Set
• Link to documents from form
• Remove documents from form
SharePoint Saturday
Brisbane 2012
17. 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:Attachmen
tUrl>
• </my:AttachmentUrlRptTbl>
– Remove attachment, clear checkbox so people can add another document
• update XML to update attachment URL, Remove Attachment and clear checkbox
SharePoint Saturday
Brisbane 2012
19. 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
SharePoint Saturday
Brisbane 2012
20. 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
SharePoint Saturday
Brisbane 2012
24. SharePoint Saturday
Sponsors
Gold
Thanks for listening!
Remember to submit your feedback so Silver
you can go into the raffle draw at the
end of the day! And don’t forget that
Bronze
you have to be at the draw to claim your
prizes!