Trip Interface Description 1.2.2 Help

Number

A question of type number allows the user to enter a number. This can either be a negative or positive number with or without decimals, depending on the supplied question options.

{ "id": 0, "key": "number", "type": "number", "label": "Basic number", "description": "A basic numeric question", "required": true, "answers": [ { "id": 0, "nextQuestionId": 1, "options": { "minValue": -10, "maxValue": 10 } } ] }

Question options

This chapter describes the option possibilities for this question.

Name

Type

Description

Required

minValue

double

The minimum value the answer should be

false

maxValue

double

The maximum value the answer can be

false

minLength

int

The minimum length the answer should be

false

maxLength

int

The maximum length the answer can be

false

decimals

int

The number of allowed decimals

false

Examples

Example with a configured minValue and maxValue

Number question with min/max value
{ "id": 0, "key": "number", "type": "number", "label": "Basic number", "description": "A basic numeric question", "required": true, "answers": [ { "id": 0, "options": { "minValue": -10, "maxValue": 10, "decimals": 2 } } ] }

Example with a configured minLength and maxLength

Number question with min/max length
{ "id": 0, "key": "number", "type": "number", "label": "Basic number", "description": "A basic numeric question", "required": true, "answers": [ { "id": 0, "options": { "minLength": 1, "maxLength": 5 } } ] }

Example with a configured number of decimals

Number question with max length and decimal
{ "id": 0, "key": "number", "type": "number", "label": "Basic number", "description": "A basic numeric question", "required": true, "answers": [ { "id": 0, "options": { "maxValue": 5, "decimals": 2 } } ] }
Last modified: 26 May 2025