Skip to content

Data types

A part's dataType determines the structure of the answer data inside answer.value.

  • string
  • number
  • options
  • upload
  • info
  • section
  • page
  • groupstart
  • groupend
  • expression
  • aggregate
  • identify

Input types

  • radios
  • checkboxes
  • textarea

These combine to the following

number:number
  -> input type=number, + various params like min/max/step, decimals
string:text
  -> input type=text, opts: length, regex...
string:textarea
  -> textarea, opts: length, regex, size...
string:email
  -> input type=email
string:url
  -> input type=url
options:radios
  -> input type=radio, possibly plus other. Opts: values inc. other,
options:checkboxes
  -> input type=checkbox, possibly plus other. Opts: values inc. other
upload:upload
  -> complex widget using input[type=file]
section, page, groupstart, info all use container
  -> Just shows the 'suffix' text. The label is used for admin overview.
identify:identify
  -> complex widget providing first, last name and email - use for open surveys.

Ideas (unimplemented)
options:select
  -> select, possibly plus other. Opts: values inc. other

number:range
  -> 1=bad 10=good

Number

  • structure: any valid number in JSON
  • ask: number input. Needs to know decimals, min, max, decimalPlaces

Options

  • structure: a presets array stores the order and the values selected, including any special values that start with _other_. A other object maps selected other values to what the user provided for that.

    { presets: [ 'presetValue1', 'presetValue2', ..., '_other_val1'],
      other: { "_other_val1": "user entered text" }
    }
    
    - Means you can use more than one 'other' field, should you wish to, which allows you to keep the context better. e.g. options could be

[
  { value: "_other_awful", label: "Awful" }
  { value: "meh", label: "Meh" }
  { value: "_other_great", label: "Great" }
]

which would allow user to enter something against awful or great.

  • ask: single answer questions, with or without other value(s).

  • tell: various options for presenting these.

String

  • structure: any valid string.

  • ask: text inputs, textarea, urls, emails, phone numbers

  • tell: may make it into hyperlink, or just display.

Sections, pages, groups.

  • section, page, groupstart, groupend

Expression

The value of this part is determined from an expression that (typically) draws on other data for this participant.

Aggregate

The value of this part is determined from an expression that draws on data from (a subset of) all participants, e.g. rank.

Identify

Used for open surveys, this composite field will take first, last name and email. This data is used to identify/create a contact using the XCM extension, and after that, an open survey will look for or create a participant for the configured survey for this contact.