Add list items for forms

Last updated Thursday, November 2, 2017 in Sitecore Experience Platform for Content Author, Developer, Marketer
Keywords: Items, Web forms

In a form, you can specify the options that you want to display in a list field. A list field lets users select one or more options from a predefined group of values. List fields can have both a value and text. The value is stored in the database and used for statistics.

The Forms application contains default list elements for drop-down lists, list boxes, check boxes, and radio button lists. A list item can connect to existing data, or it can display a fixed value that you enter when you create the item.

This topic describes how to:

Add a list item manually

For all list elements, you can manually enter the values that you want to display in the list.

To add list items manually:

  1. In the Form elements pane, click the list element that you want to add and then drag it to the form canvas.
  2. When you have found the right place for your element and a green line appears, drop the element.
  3. In the Forms elements pane, in the List items section, ensure that Static is selected (this is the default).
  4. In the Radio button 1 label field, enter the value for the first list item.
  5. Click Add new to add the next list item.

    Click add a new list item.

  6. In the values list, specify the value of the list item that is saved to the database. The options are:
    • Same as labels – the values reflect the labels. This is the default.
    • Customized – to enter custom values. It can be convenient to enter custom values, for example, when you use different language versions of your form and want to save the original language values to the database.

    Radio button list

  7. In the Validation section, in the Field importance item, specify whether the contact must fill in the relevant field. The options are:
    • Mandatory – the field is required.
    • Optional – contacts can decide whether they want to fill in the field.

Assign content to a list item

You can enter the list items manually but you can also bind them to a data source. The Sitecore Forms module lets you work with Sitecore content in your forms. This can be convenient when you expect the list items to change regularly because the list items will automatically change when the data source changes. For example, items that list the available products on a product inquiry form or a request demo form.

Assigning content to list items can also be convenient for recurring lists such as a radio button list that indicates the level of customer satisfaction.

To assign content to a list item:

  1. In the Form elements pane, click the list element that you want to add and then drag it to the form canvas.
  2. When you have found the right place for your element and a green line appears, drop the element.
  3. In the Form elements pane, in the List items section, select Dynamic to select a data source.

    Click Dynamic.

  4. In the Select a data source for the control dialog box, navigate to the item on your website that contains the subitems corresponding to the field values that you want to display. Select the relevant item, and then click Select.

    For example, to add a question on customer satisfaction, select Customer satisfaction:

    Select the data source that you want to use for the list.

  5. In the Value field field, select the value field that you want to display.

    Don't forget to select a value.

  6. In the Selected radio button drop-down list, select a list item that is preselected by default.

    Click Neutral.

  7. In the Validation section, in the Field importance item, specify whether the contact must fill in the relevant field. The options are:
    • Mandatory – the field is required.
    • Optional – contacts can decide whether they want to fill in the field.
Send feedback about the documentation to docsite@sitecore.net.