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

Comments on this entry:

Gravatar # re: Automatically setting file name when submitting InfoPath 2010 Form
by Mahsa at 12/3/2011 10:07 AM

thank u very much! it totally works!:)
Gravatar # re: Automatically setting file name when submitting InfoPath 2010 Form
by karthi at 1/6/2012 1:48 AM

hi,
Is it possible to change the submit button to save?
I tried changing the label "Submit" to "save" in the "Submit Options dialogue" But,when I preview the form with infopath, the Submit button is now named Save. But when I preview the form in the browser, it still shows up as Submit.

Is there a way to rename the Submit button in browser forms?
Gravatar # re: Automatically setting file name when submitting InfoPath 2010 Form
by Danny at 3/6/2012 10:24 AM

This is great, is there a way to add multiple fields or functions to genereate the filename?
Gravatar # re: Automatically setting file name when submitting InfoPath 2010 Form
by Frank Ball at 4/23/2013 4:34 PM

I have a similar issue, but with small variation - I'm using a repeating table to insert records in parent/child format. I've tried adding a field that I increment after the submit and using it in the filename, but that's failing since (I assume) the submit process is submitting all the records at once, so my incrementing isn't getting applied to each record. So when using a repeating table (or section), how do you handle assigning a unique name? OR How do I set the field so that it doesn't require a unique name (I can assure that all child records have a common unique parent)?
Gravatar # re: Automatically setting file name when submitting InfoPath 2010 Form
by Kyle at 6/17/2013 4:32 PM

@Danny, you can use the concat() function in the Fx window to combine multiple fields.
______________________________________

This is a great tip for auto-naming, OOTB. However, it doesn't handle form versioning well. If I submit a form, and then return to it later and edit one of the fields that is a component of the filename, then I get a whole new second file reflecting that change instead of renaming my original file.

Any idea how to counteract this?
Gravatar # re: Automatically setting file name when submitting InfoPath 2010 Form
by Piera at 6/10/2014 4:48 PM

Does anyone know how to use concat() function I need it to name it automatically and then send it to sharepoint list so I dont get the error that the form already exists. Is there anywhere that has a step by step guide on how to do this and for Infopath 2013?
Post A Comment
Title:
Name:
Email:
Comment:
Verification:
 
 
Twitter