Feedback answer format

Declare text, quantity, scale, and choice answers for custom feedback forms.

Last reviewed

Use these objects in the answers array of an HTTP source feedback operation or as structured content for client.feedback(). Each answer has a value and may include a question definition. The value is what the person entered; the question definition describes the question your form showed. Quantity, scale, and choice answers require a question definition; text answers can omit it.

[{"value": "Search","question": { "type": "text", "text": "What should we improve?" }},{"value": 1.5,"question": {"type": "quantity","text": "How long did setup take?","unit": "hours"}},{"value": 4,"question": {"type": "scale","text": "How was setup?","min": 1,"max": 5,"labels": { "1": "Hard", "5": "Easy" }}},{"value": [{ "type": "option", "value": "docs" },{ "type": "text", "value": "A teammate" }],"question": {"type": "choice","text": "What helped?","options": [{ "value": "docs", "label": "Documentation" }],"multiple": true,"allowOther": true}}]

Answer types

  • Text: value is a string. Its question definition is optional.
  • Quantity: value is a finite number; negative and fractional values are allowed. The question definition can include unit, min, and max to describe the value and its bounds. The value must be within supplied bounds, and min cannot exceed max.
  • Scale: value is an integer. The question definition supplies integer min and max bounds, with min ≤ value ≤ max. Optional labels maps scores, written as string keys, to labels.
  • Choice: The question definition's options lists { "value", "label" } pairs. value is always an array: use { "type": "option", "value": "…" } for a listed option or { "type": "text", "value": "…" } for an Other response. Set multiple to allow several entries and allowOther to allow text entries. Both default to false; option values must match options, and a single-choice answer can contain at most one entry.

Question definitions can also include an optional key and description.

For the current server endpoint and authentication setup, see HTTP source. The JavaScript SDK reference describes the client surface and its published availability.