The dvalue
tag sets a value to a question or variable. It populates on page load. In the case of visible, respondent-facing questions, respondents can accept the default response and proceed to the next page, or they can choose a different response.
Syntax
dvalue: Value or expression
Examples
Question default value
The below example will have 'mango' pre-selected when the respondent first sees the page. The respondent can then click forward or change the pre-selected answer.
Invisible variable with expression
The below example takes a numeric value given by a respondent and can compute calculations. A new page
tag is needed after the initial question as the dvalue variable will compute on page load.
Invisible variable to collect information from invite link
The following example illustrates a common use case for dvalue
when a survey is fielding across multiple countries. The 'QCNTRY' variable uses getParm
to extract the country parameter from the invite link, indicated by the 'c' parameter, identifying the respondent's country. In this instance, the 'c' parameter corresponds to Great Britain, which is option code 11. Then, dvalue
punches that same value/code in 'QCNTRY'.
##Example invite link https://SERVERHERE.intellisurvey.com/pub/SURVEYIDHERE?c=11 set list: COUNTRYLIST 11. GB 25. NL 30. NO 31. SE CNTRY. Country type: radio chapter: S translate: n invisible: y dvalue: if (getParm('c')>0) {getParm('c')} else {9999} opts from: COUNTRYLIST 9999. No country assigned
Comments
0 comments
Please sign in to leave a comment.