Rating field
Use a rating field when you want respondents to choose a star score. You can set the number of stars and optionally preselect a score.
Configuration
The table lists the rating-specific properties. For properties shared by all fields, see Shared properties.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
max | integer | No | 5 | Number of stars, from 1 to 10. |
defaultValue | string | No | None | A whole number written as a string, such as "4". Selects the stars initially. |
Validation
If the field is required and no star is selected, the respondent cannot continue. Clicking the selected star again clears the rating.
Submission value
A rating is stored as a number under the field’s name in the submission data. If the rating is cleared, its value is null.
For example, a selected four-star rating is stored as:
{
"support_rating": 4
}Example
{
"type": "rating",
"name": "support_rating",
"label": "How would you rate our support?",
"max": 5,
"required": true
}