Skip to content

SharePoint Drop-Down Component

The SharePoint data component allows you to easily display information from a data source in a drop down menu, this can include SharePoint lists, Excel files and much more!

The component stores the selected source row as an object. Configure Fields with every property that the form needs to retain; calculations can then read values such as data.site.SiteCode. Do not configure Form.io’s valueProperty, because that would discard the row object Team Forms expects.

Remove Duplicates compares the complete stored objects after Fields has been applied. If the drop-down displays Location but Fields also retains SiteCode, two rows with the same location and different site codes are not duplicates. To show unique locations, set Fields to only Location. Only that field will then be stored, so include additional fields when the form needs them and accept that uniqueness applies to their combined values.

Other advanced settings include:

Builder settingSchema propertyBehaviour
SharePoint ListdataSourceIdExact ID of an existing Team Forms data source.
Item TemplatetemplateHTML using item, for example <span>{{ item.Location }}</span>.
Label PropertylabelPropertyWhen setting Item Template directly, use { "label": "🛠 Custom", "value": "custom" } so the custom template remains editable in the builder.
FieldsselectFieldsProperty paths retained in each selected object.
Sample ItemsampleItemA representative projected row used for email suggestions, connector schemas, and advanced-code types. The builder normally derives it from preview data.
Remove DuplicatesremoveDuplicatesRemoves identical projected objects.
Sort BysortByProperty path used to sort the rows.
Sort DirectionsortDirectionasc or desc.
Filter QueryfilterQueryJavaScript that assigns show using the current item and form data.

See the data-source component schema reference for complete JSON examples and AI-assistant rules.

The SharePoint drop-down component can also be customized to render a custom template for each item. This powerful feature gives you full control over what is displayed using standard HTML syntax. To use a custom component simply:

  1. Open the data tab of your SharePoint data component

  2. Under the “Label Property” field choose “🛠️ Custom”. This will launch a HTML code widow to provide a custom template.

You can use this to display multiple fields from your drop down menu or style the items how you like. Below we provide two common examples of using the custom template feature.

Using the custom template feature you can display multiple fields/columns from your data source in a single item of the drop down menu. In the Example below we show how you can display a users first name, last name and position.

Item template:

<div>{{ item.firstName }} {{ item.lastName }}</div>
<small>{{ item.position }}</small>

By default the SharePoint data component will display a single line of text for consistency of sizing and spacing among other components. However in some circumstances it may be desirable for the text inside the component to wrap over multiple lines to display a larger amount of text. In these situations you can use custom inline CSS in your template to force the text to wrap.

Item template:

<div style="text-wrap:wrap">{{ item.description }}</div>