Overview
Forms are made up of components, which are individual question or input blocks. Each component has a set of configurable elements and optional validation rules. You can also set conditional logic on individual fields to show or hide them based on a respondent’s previous answers.
Component types
When building a form, click Add Component to get started. The following component types are available:
| Component | Description |
|---|
| Short answer | A single-line text input. |
| Paragraph | A multi-line text input. |
| Number input | A numeric input field. |
| Dropdown | A list of options where the respondent selects one. Supports static options or dynamic options. |
| Radio buttons | A list of options where the respondent selects one. |
| Checkboxes | A list of options where the respondent can select multiple. |
| Rating | A set of rating questions. |
| Toggle | A boolean on/off switch. |
| Ranking | A ranked ordering of a list of options. |
| Date picker | A calendar date selector. |
| Image | An image embedded in the form for context or instructions. |
Component elements
Each component has a set of configurable elements in the component editor:
| Element | Description |
|---|
| Add a description | An optional description displayed below the component question. |
| Required | Toggle to determine whether the question requires an answer. Required questions are marked with a red asterisk. |
| Advanced | Configure the placeholder text and default value for the component. |
| Rules | Configure validation rules to restrict the values respondents can submit. See Validation rules. |
| Conditions | Configure conditional logic to show or hide the component based on a respondent’s previous answers. See Conditional fields. |
| Style | Change the component type while preserving its existing options. For example, switch a dropdown to checkboxes without removing and recreating the component. |
Validation rules
You can configure validation rules on individual components to restrict the values respondents can submit.
For short answer and paragraph components, you can set a minimum and maximum character length, or restrict input to a specific pattern: email, URL, alphanumeric, or a custom regex.
For number input components, you can set a minimum and maximum value.
Conditional fields
Conditional fields let you show or hide a question based on a respondent’s answer to a previous question. For example, you can show a follow-up question only when a respondent selects a specific option from a dropdown.
To configure a conditional field:
- Click a component to open its editor panel.
- Click Conditions.
- Click Add Condition and define the rule.
- Click Save.
You can also view conditions in the Fields panel by clicking the branch icon.
Dynamic dropdown options
Dropdown components can fetch options dynamically from Datadog tag values at runtime. Dynamic options update automatically as your tag values change, without requiring manual edits to the form.
To configure dynamic options:
- Click a dropdown component to open its editor panel.
- Click Advanced.
- Under Options source, select Dynamic.
- Select the tag key to use as the source of options.
- Optionally, configure substring filtering or cross-tag scope constraints.
- Click Save.
JSON editor
In addition to the visual component editor, you can edit the underlying JSON Schema of the form directly. In the Fields panel, click the code icon to open the JSON code editor.
Further reading
Additional helpful documentation, links, and articles: