InfoPath: Create Common Multiple Choice Selections

STOP USING INFOPATH

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.

13 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.

  • 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.

  • Duffbert,
    Thanks!! Cool!

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

  • 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?

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

  • 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

  • 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).

  • 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!

  • Sunshine Flowerss

    Hi!

    Thanks for this post. How do you do the same thing by adding a Data Connection to a SharePoint List. I have a field with over 100 companies listed. However, I will need to use this all over the form in the exact same manner that you listed above. I could follow these steps and copy and paste the 100 companies as a choice.

    However, since I already have the field I want to use. How do I repeat it. Especially when it’s already in use. I tried to just drag and drop the same field. However, it populates the same option all over the form and each time it’s used, it should be blank until someone makes a selection within it.

    Please help. I’m using SP 2013.

    Thanks,
    Flowerss

    • Your list of companies should be a SharePoint list, and when you need to do a drop-down to pick a company, use a lookup field to that list. Make it a lookup instead of a choice field, and it will always be dynamic.

    • Sunshine Flowerss

      Hi,

      Thank you for responding so quickly. You always have the best response time. Regarding the lookup. I tried that first. I was then lead down a rabbit hole of “roundabouts”. The lookup doesn’t allow me to select the company field. In SP 2013. I’ve read-and the article may be false-that if you have multiple choices or used the instance before, then it wont appear in the lookup when you try to use it a second time.

      Thanks,
      Flowerss

  • Hi Laura,
    i ran into a similar situation where in have 42 fields that will need use the same dropdown choices. After googling I found your post to be more close to my issue. When i tried “In InfoPath Designer, in the Fields pane on the right, right click the MyFields folder (root folder) and click Add…” the Add option is greyed out and I couldn’t find any way to add the new folder.
    Any suggestion would be greatly appreciated!

  • with the above question, the 42 field I need them to stay in the InfoPath form instead of creating 42 columns in the the list.

Leave a Reply