Automatically setting file name when submitting InfoPath 2010 Form

After creating my InfoPath form and setting it to publish to a Forms Library in SharePoint 2010, I found that I wanted to fine tune the experience that the user has when submitting a form.

The first thing to change was the annoying dialog asking the user for a filename. Many users will have no idea what SharePoint is asking them for, or worse, they enter a name that’s already used by another form (and either overwriting it or getting an error).

To see what I mean, simply create an InfoPath 2010 form and set it to publish to a SharePoint 2010 Form Library. It doesn’t matter what fields and columns there are.

Now, click on Add Document in the form library and you should see your form, something like this:

clip_image002

Fill out your form and then click the “Close” button – which isn’t obvious for end users.

clip_image004

Although probably confused, end users will most likely pick “Yes” here.

The next dialog is really confusing:

clip_image006

SharePoint is asking for the filename to save the form as in the Form Library. However, unlike a more standard save dialog, this one doesn’t let you see what the existing files are named, so the users are given very few clues as what is expected.

Instead of asking our end users these questions, we can just setup a formula that will automatically determine the filename.

First, either create an InfoPath form that publishes to a SharePoint library or open one you’ve already created. Next, in InfoPath, go to the File menu (backstage) and select Info, and then click on “Submit Options”:

clip_image008

On the Submit Form drop down menu, select “Submit Options”:

clip_image010

The Submit Options dialog window will appear.

· Check the box to “Allow users to submit this form”

· Under “Send form data to a single destination”, choose “SharePoint document library”

· Click the “Add…” button in the “Choose a data connection for submit” area

        o Enter the address for the document library

clip_image012

        o And here’s what we’ve been looking for: a place to enter a formula that will create the filename for the users – enter what you want here. Remember, you can use a field on the form as well as other variables (such as date and/or time)

       o Also, select if you want to allow your users overwrite a form that’s already been submitted

       o Click Next

       o Click Finish

· Now click Advanced, so more options are displayed

      o Under advanced, you can select if you want to display a message if there’s an error and/or if the submit was successful

      o You can also choose what to do from there – Close the form, Open a new one, or Leave the current one open

Publish the form and now you should see something like this when you create a new form to submit:

clip_image014

Notice the buttons in the ribbon – there’s now a “Submit” button, along with the default buttons. That’s better, but it’s not quite what I want.

So, open the form back up in InfoPath Designer, and go to the File menu (backstage), select Info, and then click on Form Options at the bottom:

clip_image016

In the Form Options window, the first set of choices is for the form in a Web Browser:

clip_image018

Here is where you can set which buttons to display in the ribbon. Make any changes you want, click, and then Publish the form.

clip_image020

If you don’t want to use the ribbon at all, you can add a button to the form and set it to be the submit button.

Print | posted @ Tuesday, May 31, 2011 9:51 PM