Mobility Blog

Tech tip: Switch InfoPath views on form open for a better user experience

mm

Written by 

Ms. Neagu is a noted expert on data applications and XML technologies. Adriana was co-inventor of Microsoft Office InfoPath, and co-holds 4 InfoPath patents.

Routing form

Here’s a little trick that opens up a world of possibilities in InfoPath forms and Formotus mobile applications.

One common UI design approach is to treat InfoPath views like Web pages and use buttons to let the user navigate among views. This is a well established design pattern that can work quite well, but it does put the responsibility on the end user to navigate to the right view. Why not open the InfoPath form to the right view in the first place? Fortunately there’s a way for you to control which view opens depending on the situation.

There are a number of scenarios where you might want different views to open in different situations.  A simple example would be a form with two views: one view with input controls for filling out a new form, and another view that’s read-only for forms that have already been submitted and can’t be changed. In this case restricting a user to the read-only view is more than a convenience feature, it actually protects the data integrity in the form.

Use a form load rule to switch views

Here’s the trick. On the Data tab in InfoPath Designer there is a Form Load button that lets you create rules that will run whenever the form is opened.  By applying rules to switch views conditioned on a field value in the form, you can exert all kinds of control over what the form user will see.

See Microsoft instructions here.

Beyond the simple scenario of opening a read-only view after a form has been submitted, this method enables some really powerful scenarios for structured collaboration among multiple users of a form.

Consider this form we created to demonstrate routing a job through four task steps.

Routing form

The idea here is that four different people (initiator, approver, worker, reviewer) will open this form and each will see a different view depending on the disposition of the form. Here’s what the screenshot shows:

  1. Data tab
  2. Form Load button
  3. The AssignedFor field value is used to control the view
  4. A different view exists for each user/role
  5. A rule is set for each view, on the pattern: “if AssignedFor=Approval then switch to view Approver”

Then all you need is a mechanism for setting the AssignedFor field value. You might include a dropdown list for users to set the status, or you might put rules on the submit button that increment the field value before submitting, among other possibilities.

Perfect for a mobile solution

Showing task-focused views to mobile users can turn a complex and unwieldy InfoPath form into a simpler and more and elegant user experience on smartphones and tablets.  A knowledge worker on a PC with a large screen and a precision pointing device may be fine navigating a complex interface, but a field worker with a small screen and fat fingers is a different story.

The typical end user of a Formotus mobile application is likely to be someone like a building inspector, delivery driver or equipment repair technician, and is likely more familiar and comfortable with paper forms than sophisticated software. If the person’s job is to fix a machine, snap a photo and get a signature, why burden that user with all kinds of other unneeded controls and navigation buttons?

By creating simpler views tightly focused on the next task at hand, InfoPath form design can move toward the goal of showing each person only the minimum of information and options needed to get the job done in the most direct and efficient manner. This goal is worthy in many contexts but most essential in mobile application design.