InfoPath: Create Common Multiple Choice Selections

In InfoPath, when using certain controls such as the Drop-Down List Box, Combo Box, List Box, or Multiple Selection List box, there are several different ways that you can obtain the list of choices that are available to people filling out the form.

051512_2314_InfoPathCre1

 

  • Enter choices manually – This option allows you to simply click the Add… button below and type in the values for each choice, and use the Move Up and Move Down buttons to rearrange the order.
  • Get choices from an external data source – This option allows you to select an existing data connection, such as one that receives a SharePoint list. This way, the selections can be dynamic. This is the best option to use when the values in the list change frequently. It allows you to simply change the source location, such as the items in a SharePoint list, instead of having to re-type the options in and re-publish the form.

This blog post is all about that other option, called Get choices from fields in this form.

This middle option is pretty useful in a couple of situations:

  1. You have a list of fairly static choices, but you need to use them in several places in your form. A good example is a survey. Commonly, there need to be many drop-down boxes in a survey, but they have all the same choices, such as Yes, No, Maybe.
  2. A different situation, which I don’t come across often, is when there is a repeating table or section somewhere in the form, and the values that have been filled in there, need to be the values to select from in your drop-down box.

This blog post is about option 1 above. A survey with the same set of answers being needed multiple times in the form.

Here’s how to create some choices “Yes, No, or Maybe”, using that middle option in your drop-down box, and use it in many places in the same form:

  1. In InfoPath Designer, in the Fields pane on the right, right click the MyFields folder (root folder) and click Add…
  2. Name it SurveyChoiceGroup, select Group as the type, and click OK.
    051512_2314_InfoPathCre2
  3. Right-click on SurveyChoiceGroup, and click Add… Name it SurveyChoice, and click OK.
  4. Name it SurveyChoice, check the box next to Repeating, and click OK.
    051512_2314_InfoPathCre3
  5. Your new structure in the Fields pane on the right should look like this:
    051512_2314_InfoPathCre4
  6. On the Data tab, click the Default Values button.
    051512_2314_InfoPathCre5
  7. Click the drop-down on the SurveyChoice field, and select Add another SurveyChoice below.
    051512_2314_InfoPathCre6
  8. Do this one more time, so that there are three different Survey choices under the SurveyChoiceGroup.
  9. Click to select the first of the three SurveyChoice fields. In the Default value field, type Yes
    051512_2314_InfoPathCre7
  10. Click to select the second SurveyChoice, type a default value of No, and then for the third, type a default value of Maybe. Click OK.
  11. Put a drop-down box on your form, and open its properties screen.
  12. Select Get choices from fields in this form, and choose SurveyChoice. Click OK, click OK.
    051512_2314_InfoPathCre8

Now, when you publish or preview your form, you can see that when you click the drop-down, it shows the 3 choices of Yes, No, or Maybe. You can create multiple drop-downs or any type of selection boxes, and use that same list of survey choices in all of them. Then, if the list of choices need to be edited, you can just do it in one place. Of course, this can always be done by creating a data connection to a SharePoint list, but for such a simple set of choices, all of that may not be necessary. This is just another option.

8 comments

  • Thomas Duff ("Duffbert")

    Thanks for posting this. I was able to use this technique on a form I was working on yesterday. I shared it with a colleague and she had even a better use for it on a project that she’s doing.

    I appreciate you taking the time to share this info, and the style that you use in doing so. It’s clear, concise, and easy to follow.

    Like

  • Thank you, this was very helpful. I’m wondering though – once this process is used to create a drop-down, is there a way to duplicate/apply that drop-down for each question in the survey? I’m trying to get to a one-step solution for adding the drop-down for each question, instead of having to add the control, specify the choices group, and set the default.

    Like

  • Duffbert,
    Thanks!! Cool!

    Jayson,
    Sorry, I can’t think of a quicker way.

    Like

  • I remembered this post, found it, and like it, but unfortunately I need to use radio buttons not a dropdown. Is there any way to use the same kind of trick with option buttons?

    Like

  • Glen,
    No, there isn’t, because with option buttons, your text is typed directly on the form and can’t vary.

    Like

  • This is a great page it helped me a lot,
    but is there a way of adding a value to choices, and then adding them up automatically?

    Thank you for your support

    Like

  • Steve,
    I believe you could make this list of choices editable by adding it as a repeating table to your form. Then, you could create a new field that has a default value of sum(THATFIELD).

    Like

  • The “Add..” option, as mentioned in #1 is disabled at my end. I am using Infopath Designer 2010. I would really appreciate if anyone could help me out with this. Many thanks in advance!

    Like

Leave a reply or question

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