How to Create an InfoPath Submit Button with Rules


This question came about today on twitter via Erica Toelle.  My fellow Tribridge colleague Chris Quick showed me this a while back.  This tutorial covers the process of creating a submit button with rules for a InfoPath 2007 browser-based form.

Add a button to your InfoPath web-based form.  Double-click the button and change the label to Submit.  Select the Rules and Custom Code action from the Action drop down.  Click on the Rules button to begin building your rules.

 

The Rules dialogue box will be empty.  When we are done we will have created two common rules for a submit button, which are pictured below. 

To create the Set File Name rule, click the Add button to create a new rule.  Give your rule a name (Set File Name in this example), then select Set Condition. Choose the FileName field and is blank for the condition.  Click OK.  We are creating this rule to automatically give the form a file name only when it is first submitted.  If a user is modifying an existing form, it will bypass this rule. 

 

Click the Add Action button.  We are going to set the file name’s value with this action.  It will look like the screen shot below when we are done.

Choose the Set a field’s value option from the action drop-down.  The choose the FileName field.  The picture below also shows the formula that appends the exact time the form was submitted to the file name (this ensures a unique file name).  

Here’s how we create that formula.  Within the Value section, click the fx button.  Click the Insert Function button. 

Choose Date and Time from the categories and select the today function.  Click OK.

Click OK in the Action dialogue box.  We are done with our first rule.

Create another rule to handle submitting and closing the form.  I named the rule Submit and Close.  No need to set condition on this rule, just go to Add Action.  We will create two actions (pictured below).  One will submit the form and the other will close the form. 

Select the Submit using a data connection action.

Leave the Main submit data connection.  Click Ok.

Add another action.  Select the Close the form option.  You will get this prompt if you are creating a browser-based InfoPath form.

Click Ok.  Save and publish your form to test it out.  Now you should have a functioning Submit button that creates a unique file name, and automatically closes the form.

Advertisements

7 thoughts on “How to Create an InfoPath Submit Button with Rules

    • I would just set up an alert on the library if you want certain people to be notified, or create a basic workflow that triggers on new item created in the library if you want more of a “dynamic” method to send emails to certain people based on informaiton within the form.

      Like

  1. I would like to know if I can create a button on an InfoPath 2010 form that when clicked, the form will trigger a general e-mail message to a user such as “A new file has been completed in InfoPath, please complete the process”. Let me know if this is possible.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s