Insert a drop-down list box (2024)

You can use a drop-down list box in a Microsoft Office InfoPath form template to present a list of mutually exclusive choices to a user. The list is hidden until the user clicks the arrow to the right of the drop-down list.

In this article

  • When to use a drop-down list box

  • The user experience

  • Insert a drop-down list box

  • Layout tips

When to use a drop-down list box

Use a drop-down list box when you want to:

  • Enable users to choose a single selection in a list of predefined items.

  • Hide the list entries on the form by default.

  • Display the values retrieved from a fixed list, from the form template's data source, or from an external data source, such as a database or Microsoft Windows SharePoint Services list.

In the following illustration, users categorize expenses on an expense report form by selecting predefined values in an opened drop-down list box.

Insert a drop-down list box (1)

After you insert a drop-down list box on your form template, you must specify the values that you want to appear in it. Otherwise, users will see an empty list when they click the arrow next to the drop-down list box. In the Drop-Down List Box Properties dialog box, you can type the entries yourself or configure the drop-down list box to retrieve entries from a database or other data source.

Related controls

InfoPath includes controls that are similar to drop-down list boxes but that serve different purposes. To decide which of these controls works best on your form template, refer to the following list:

List boxLike a drop-down list box, a list box enables users to select a value in a list. However, unlike a drop-down list box, a list box displays the entire list on the form. If space is not an issue on your form template, you might consider using a list box, which may make it easier for users to browse for and select items.

Combo boxLike a drop-down list box, a combo box enables users to select a value in a list. The list is hidden until your users choose to display it. However, in a combo box, users can type their own value into the list in addition to choosing from the predefined values.

Multiple-selection list boxIf you want users to be able to choose more than one item in a list, you can use a multiple-selection list box instead of a drop-down list box. Multiple-selection list boxes take the form of two or more check boxes inside a scrollable list.

Option buttonsLike a drop-down list box, a group of option buttons enables users to select from a list of mutually exclusive choices. However, with option buttons, users click a small circle to make a choice instead of clicking an item in a list box.

Top of Page

The user experience

Drop-down boxes are similar in appearance to combo boxes. If you manually type your own list items in the Drop-Down List Box Properties dialog box when you create the drop-down list box, InfoPath displays the text Select as the default entry in the list. This lets users know that they must make a selection from the drop-down list. If the list items come from values elsewhere in the form or from a secondary data source, the Select text is omitted.

When users first open a form, the list items in a drop-down box are hidden. To select an item from the list, users click an arrow on the right side of the drop-down list box and then click the item that they want.

Top of Page

Insert a drop-down list box

The procedure for inserting a drop-down list box differs slightly depending on whether you are designing a new, blank form template or basing the design of your form template on a database or other external data source.

The following illustration shows how a drop-down list box looks when it is selected in design mode.

Insert a drop-down list box (2)

Controls can be bound or unbound. When a control is bound, it is connected to a field or group in the data source so that data entered into the control is saved in the underlying form (.xml) file. When a control is unbound, it is not connected to a field or group, and data entered into the control is not saved. When you select or move your pointer over a control, text and a binding icon appear in the upper-right corner of the control. The text indicates the group or field to which the control is bound in the data source. The icon indicates whether the control is correctly bound to that group or field. When the binding is correct, a green icon appears. If there's something wrong with the binding, you'll see a blue or red icon instead.

The data source for the form template consists of fields and groups that appear in a hierarchical view in the Data Source task pane. Drop-down list boxes are always bound to fields. In the following example, the Category drop-down list box on the form template is bound to the category field in the Data Source task pane.

Insert a drop-down list box (3)

When you design a new, blank form template, the Automatically create data source check box in the Controls task pane is selected by default. This enables InfoPath to automatically create fields and groups in the data source as you add controls to the form template. These fields and groups are represented by folder and file icons in the Data Source task pane.

If you base the design of your form template on an existing Extensible Markup Language (XML) file, database, or Web service, InfoPath derives the fields and groups in the Data Source task pane from that existing data source.

Insert a drop-down list box

  1. On the form template, place the cursor where you want to insert the control.

  2. If the Controls task pane is not visible, click More Controls on the Insert menu, or press ALT+I, C.

  3. In the Controls task pane, do one of the following:

    • To automatically create a field in the data source that is bound to the list box, select the Automatically create data source check box.

    • To bind the list box to an existing field, clear the Automatically create data source check box.

      Note:If the check box is unavailable, the data source is locked. For example, if you base the design of your form template on an XML Schema, you may not be able to add new fields or groups to the data source in InfoPath. This restriction helps to prevent you from inadvertently making changes to the schema that may render it invalid.

  4. Under Insert controls, click Drop-Down List Box.

  5. If you cleared the Automatically create data source check box in step 3, select a field in the Drop-Down List Box Binding dialog box to which you want to bind the list box.

  6. To add a label to the control, type text above or to the left of the control, followed by a colon (:).

  7. To specify the values that you want to use as the entries in the list, double-click the drop-down list box.

  8. Click the Data tab.

  9. Do one of the following to populate the list box:

    Type the list box values yourself

    This option is useful when you have a predetermined, limited set of values, and you don't expect those values to change in the future. If the values do happen to change, you must publish an updated version of your form template so that users can see and use the latest list entries.

    1. Click Add.

    2. In the Value box, type the text that you want to store if a user selects this entry.

    3. In the Display name box, type the text that you want to display for this entry, and then click OK.

    4. Repeat steps 1 through 3 for each entry that you want to add to the list box.

    5. To test your changes, click Preview on the Standard toolbar, or press CTRL+SHIFT+B.

    Use values from another part of the form

    This option is useful when you want the values in your list to change, depending on other values that the users enter into their form.

    1. Under List box entries, click Look up values in the form's data source.

      The entries in the list box must be associated with a particular repeating group or repeating field on your form template.

    2. Click Select XPath Insert a drop-down list box (4)next to the Entries box, and then in the Select a Field or Group dialog box, click the repeating field or repeating group that contains the fields that will provide the values for the list box, and then click OK.

    3. Click Select XPath Insert a drop-down list box (5)next to the Value box, click the field that contains the possible values for the items in the list box, and then click OK. One of these values will be saved in the underlying XML when a user clicks an item in the list box.

    4. Click Select XPath Insert a drop-down list box (6)next to the Display name box, click the field that contains the values that are displayed in the list box, and then click OK.

      Tip:To prevent display name values from appearing multiple times in the list box, select the Show only entries with unique display names check box.

    Use values from a database, Web service, XML document, or SharePoint site

    This option is useful when you want the values in a list box to be up-to-date or refreshed regularly. The values are typically stored in a database or other external data source and are retrieved every time the form is opened.

    1. Click Look up values from an external data source.

    2. Do one of the following:

      • If you already added a data connection, click it in the Data Connection box.

      • To add a new data connection, click Add, and then follow the instructions in the Data Connection Wizard.

        The entries in the list box must be associated with a particular repeating field or repeating group.

    3. Click Select XPath Insert a drop-down list box (7)next to the Entries box, and then in the Select a Field or Group dialog box, click the group or field that contains the fields that will provide the values for the list box, and then click OK.

    4. Click Select XPath Insert a drop-down list box (8)next to the Value box, click the field that contains the possible values for the items in the list box, and then click OK. One of these values will be saved in the underlying XML when a user clicks an item in the list box.

    5. Click Select XPath Insert a drop-down list box (9)next to the Display name box, click the field that contains the values that are displayed in the list box, and then click OK.

      Tip:To prevent display name values from appearing multiple times in the list box, select the Show only entries with unique display names check box.

Top of Page

Layout tips

Use the following tips to help you refine the appearance, size, and other aspects of a drop-down list box:

  • Consider widening the drop-down list box so that it is a few spaces larger than the average width of the items in the list. That way, the list items aren't partially hidden.

  • To change the width of several drop-down list boxes at once, select the drop-down list boxes whose size you want to change, press ALT+ENTER, click the Size tab, and then in the Width box, type a new number.

  • To change the background color for several drop-down list boxes at once, select the drop-down list boxes that you want to change. On the Format menu, click Borders and Shading, and then make the necessary adjustments on the Shading tab.

  • To customize the font that appears in a drop-down list box, use the Font and Font Size boxes on the Formatting toolbar. To change the font and font size for all of the drop-down list boxes on your form template at once, click the drop-down list box that contains the formatting that you want, and then on the Format menu, click Apply Font to All Drop-Down List Box Controls.

  • If you want to adjust the spacing between a drop-down list box and the objects that surround it on the form template, you can adjust the margin settings in the Drop-Down List Box Properties dialog box (Size tab). Using margins to increase the spacing offers a finer degree of control than using paragraph breaks to increase the spacing.

Top of Page

Insert a drop-down list box (2024)

FAQs

Insert a drop-down list box? ›

Tap the cell or cells where you want to create a drop-down list. Tap Data Validation. Under "Criteria," choose an option: List of items: To add an item, tap +Add and enter an item.

How do I add a drop-down list to a spreadsheet? ›

Tap the cell or cells where you want to create a drop-down list. Tap Data Validation. Under "Criteria," choose an option: List of items: To add an item, tap +Add and enter an item.

How do I create a drop-down list in Microsoft forms? ›

Re: Drop down box and lists
  1. Choose dropdown as question type on Microsoft Forms.
  2. List all answers you would like to add as dropdown on an excel sheet.
  3. On excel sheet, select all and copy (CTRL+C)
  4. Paste (CTRL+V) them to first answer option space on Microsoft Forms.

How do I edit a drop-down list? ›

Edit a drop-down list with items that have been entered manually
  1. On the worksheet where you applied the drop-down list, select a cell that has the drop-down list.
  2. Go to Data > Data Validation.
  3. On the Settings tab, click in the Source box, and then change your list items as needed.

How do I create a drop-down list in Outlook? ›

In the Content Control Properties window, click the Add button, then type the first item in the Value box (the Display Name box will get filled automatically), and click OK. Repeat for all other items you wish to include in the list. Remove the default "Choose an item", and then click OK to save your list.

How to create drop-down list in spreadsheet with multiple selections? ›

How to make Excel drop down with multiple selections
  1. Select one or more cells for your dropdown (D3:D7 in our case).
  2. On the Data tab, in the Data Tools group, click Data Validation.
  3. In the Allow drop-down box, select List.
  4. In the Source box, enter the formula that indirectly refers to Table1's column named Items.
Feb 5, 2024

How do I add a yes no dropdown in sheets? ›

Click the Data option on the Google Sheets menu and select Data validation. Click Add rule in the Data validation rules side pane. Then select Dropdown as your Criteria. Type TRUE and FALSE in the option fields and use a custom color for each.

How do I create a drop-down list from an existing list in Excel? ›

Select the "list" option for the validation, then define the column B as the list. Make sure the check mark is set on "In-cell dropdown". Then you'll have a dropdown list with the already present values in the column. You can also add new values because they will become part of the list that validates the entries.

What is the drop-down list tool? ›

A drop-down list in Excel is a handy tool used to restrict the data input into a cell. It allows users to select a value from a predefined list, making data entry quicker and reducing the risk of errors.

How do you insert a multiple selection list box in Excel? ›

Under Insert controls, click Multiple-Selection List Box. If you cleared the Automatically create data source check box in step 3, select a repeating field in the Multiple-Selection List Box Binding dialog box to which you want to bind the multiple-selection list box.

What is a list box in Excel? ›

List Box in Excel is used to create a list inside the box and choose them. We select the values from the dropdown. List boxes are available in the Insert option in the Developer menu tab. We can use List boxes with VBA macro and also Excel cells.

Top Articles
Latest Posts
Article information

Author: Arielle Torp

Last Updated:

Views: 6583

Rating: 4 / 5 (41 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Arielle Torp

Birthday: 1997-09-20

Address: 87313 Erdman Vista, North Dustinborough, WA 37563

Phone: +97216742823598

Job: Central Technology Officer

Hobby: Taekwondo, Macrame, Foreign language learning, Kite flying, Cooking, Skiing, Computer programming

Introduction: My name is Arielle Torp, I am a comfortable, kind, zealous, lovely, jolly, colorful, adventurous person who loves writing and wants to share my knowledge and understanding with you.