Respondent variables in scripting

Use scripting to get respondent variable values such as response start time, locale, and display type.

Note:
  • Respondent variable values are read-only.
  • All respondent variables are available in OnComplete and OnLoad.
  • To access Member ID, use member.id instead. For more information, see Profile and system variables in scripting.
Property Description
response.startedAt The UTC date and time at which the participant started the survey.
response.locale

The locale of the survey response (for example, en-CA or fr-CA).

Tip: You can verify the locale value by checking Product Settings > Technical Config. For more information, see View or edit community settings in the Community documentation.
response.displayType The device the participant used. Possible values include Mobile and Desktop.

Use cases

  • Script logic based on language or community

    For example, let's say you want to show error messages in English and German for different communities. You can use const locale = response.locale; to get the response locale.