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:
valueis a string. Its question definition is optional. - Quantity:
valueis a finite number; negative and fractional values are allowed. The question definition can includeunit,min, andmaxto describe the value and its bounds. The value must be within supplied bounds, andmincannot exceedmax. - Scale:
valueis an integer. The question definition supplies integerminandmaxbounds, withmin ≤ value ≤ max. Optionallabelsmaps scores, written as string keys, to labels. - Choice: The question definition's
optionslists{ "value", "label" }pairs.valueis always an array: use{ "type": "option", "value": "…" }for a listed option or{ "type": "text", "value": "…" }for an Other response. Setmultipleto allow several entries andallowOtherto allow text entries. Both default tofalse; option values must matchoptions, 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.