Skip to main content

Creating a Routing System Using InfoPath and Designer Workflows

  • Chapter
  • First Online:
Book cover Creating Business Applications with Office 365
  • 1328 Accesses

Abstract

Microsoft has announced that InfoPath 2013 will be the last version of the product, but it is still supported in Office 365 and looks to be available in the upcoming SharePoint 2019. While it is an older technology, the combination of InfoPath forms and SharePoint Designer workflows is still a powerful combination. In a later chapter, we show how to build forms with PowerApps. These will get additional capabilities and will likely eventually replace InfoPath. This example comes for a request for a way for the cadet squadrons at the Air Force Academy to route approvals through the appropriate chain of command. Before we created this solution, documents and approvals were emailed from person to person, with no good way to check the status to see where it might be stuck.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 29.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    See “What’s coming with SharePoint Server 2019 on-premises” at www.techtask.com/whats-coming-sharepoint-server-2019-premises.

  2. 2.

    Squadrons are broken into flights and elements. So a cadet who needs approval to travel to a family wedding, for example, might select the B2 approval, which goes to the B2 element leader, the B flight commander, the cadet squadron commander, and then the air officer commanding.

  3. 3.

    This was a reasonable upper limit in our usage, but you could pick a higher or lower number.

  4. 4.

    We have found in practice that the squadrons prefer to leave the form open and NOT have the approval locked down for only the named user. This is because cadets might be travelling on an away trip for a sports team or club. Rather than holding up the process, the deputy or a designee will approve instead and put a note in Approver’s Notes to that effect.

  5. 5.

    Note that only the first approver is required. The workflow logic will figure out how to know when the final approver (2–8) has been reached.

  6. 6.

    We sort by Title and check the box to Automatically retrieve data when the form is opened so that drop-down list is ready to go right when the user opens the form.

  7. 7.

    The controls with a dotted line around them are calculated controls. I use those so that the user is not tempted to type in them. Instead, they are loaded programmatically as we will see shortly.

  8. 8.

    The userName() function is very handy. As we will see later, I commonly have a custom SharePoint list with the authorized users for a particular section of the form listed in the Person column. One thing to watch is that you will need to change the column to display the Account rather than the default Name (with presence) if you will be comparing their values to the userName() function.

  9. 9.

    Getting the proper email address out of the user name requires the use of some functions to strip out the unneeded parts. Here is how it looks for an Office 365 account: concat(“mailTo:”, substring-after(username(), “i:0#.f|membership|”), “?subject=”, RequestSubject). This allows the user to easily launch their email client to send an email the form creator with questions or instructions.

  10. 10.

    I will often use a date time stamp as part of the title. But if you do this, don’t use the now() or today() functions as part of the form title, as that will make your title change, giving you multiple copies of the same form. Instead, use these functions to set the default value of a field and use that field value in the title. Then the title won’t change unless the user manually changes the date (if it is on the form and not hidden).

  11. 11.

    I typically use one workflow and run it both when the item is added and when it is modified. This means that you need to take into account both cases when creating your logic.

  12. 12.

    InfoPath uses Boolean fields where the values can be true or false. SharePoint itself and SharePoint Designer goes with Yes/No where the values can be Yes or No. These are interchangeable.

  13. 13.

    We use the Level2AccountId and similar fields from the InfoPath form (see Figure 130) for this purpose. If Level2AccountId is blank, then we set hasLevel2Approver to No.

  14. 14.

    Notice how both InfoPath and Designer like to put in spaces to make fields and variables more readable. That’s why the “To” email shows Level 2 Account Id.

  15. 15.

    Note that you can copy and paste these actions.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Jeffrey M. Rhodes

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Rhodes, J.M. (2019). Creating a Routing System Using InfoPath and Designer Workflows. In: Creating Business Applications with Office 365. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-5331-1_19

Download citation

Publish with us

Policies and ethics