Add list items for forms

Current version: 10.1

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.

Sitecore Forms 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.

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. On the form canvas, click the list element to select it.

  3. In the Forms elements pane, in the List items section, ensure that Static is selected (this is the default).

  4. In the first label field, enter the value for the first list item.

  5. Click Add new to add the next list item.

    In the following example, a new Radio button label is to be added.

    Add 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. If you choose Customized, make sure you add information into both the label(s) and value(s) boxes. Otherwise, when a customer selects an item from the list, this choice will not be saved to the database.

      Customized radio button values.
  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. Sitecore Forms 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. On the form canvas, click the element to select it.

  3. In the Form elements pane, in the List items section, select Dynamic to select a data source.

  4. In the Select a data source for the control dialog box, go 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 a data source for the control.
  5. In the Value field field, select the value field that you want to display.

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

    Selected radio button field.
  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.

Do you have some feedback for us?

If you have suggestions for improving this article,