SharePoint SaturdaySponsorsGold
Silver
Bronze
Advanced InfoPath and Workflow Techniques
Kevin AnnfieldOBS
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
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
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.
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
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
SharePoint Saturday Brisbane 2012
Data Connections
• SharePoint Lists• Web Services– SOAP (userprofileservice.asmx)– REST (listdata.svc)
• SQL Server– Limited functionality– Use External List
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
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.
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
SharePoint Saturday Brisbane 2012
Setup REST in InfoPath
• See blog post
• http://kevinannfield.wordpress.com
SharePoint Saturday Brisbane 2012
BUILD A REST DATA CONNECTIONApproval Form Demo
SharePoint Saturday Brisbane 2012
REST Web Service
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
SharePoint Saturday Brisbane 2012
Attachments - Solution
• Copy documents into a Document Set• Link to documents from form• Remove documents from form
SharePoint Saturday Brisbane 2012
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
SharePoint Saturday Brisbane 2012
COPY AND LINK ATTACHMENTSApproval Form Demo
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
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
SharePoint Saturday Brisbane 2012
IN FORM TASK APPROVALApproval Form Demo
SharePoint Saturday Brisbane 2012
QUESTION AND ANSWERAdvanced InfoPath and Nintex Workflow Techniques
SharePoint Saturday Brisbane 2012
Related Links
• http://connect.nintex.com
• http://kevinannfield.wordpress.com
• Feedback athttp://tinyurl.com/bnefeedback
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