Formulas to access respondent properties
There are several functions that help you access respondent properties.
For all these functions, output is a string. If the variable is absent for the respondent, returns an empty string (which if needed inside an algebraic function or another function that demands a number, is converted to 0
).
GETvariable
Retrieves the value of a GET variable passed to Conjointly.
Usage: GETvariable({variable_name})
Examples:
GETvariable("var1")
[var1]
(This simplified notation using square brackets only works in redirects)
Further examples are provided below.
Formula | If the variable is empty | If the variable value is 13 | If the variable value is qwerty |
---|---|---|---|
GETvariable("var1") | (empty string) | 13 (string) | qwerty (string) |
GETvariable("var1")==13 | false | true | false |
GETvariable("var1")=="qwerty" | false | false | true |
GETvariable("var1")=="" | true | false | false |
GETvariable("var1")=="0" | false | false | false |
GETvariable("var1")==0 | false | false | false |
GETvariable("var1")+3 | 3 (number) | 16 (number) | 3 (number, because + does not work as a concatenator) |
respondentInfo
Retrieves certain types of information about the respondent (such as IP address or locale).
Usage: respondentInfo({information_type})
Examples are provided below.
Formula | Value |
---|---|
respondentInfo("id") | 12345 (string) |
respondentInfo("id")+0 | 12345 (number) |
respondentInfo("id")+1 | 12346 (number) |
respondentInfo("ip") | 12.12.12.12 (string) |
respondentInfo("var1") | (empty string) |
respondentInfo("") | (empty string) |
Below are all possible information types. THeir availability depends on whether anonymisation is enabled for the study.
Information type | Corresponding column in Excel exports | Available in the survey for piping when responses are anonymous | Available in the survey for piping when responses are not anonymous |
---|---|---|---|
id | Participant ID | ✅ | ✅ |
conjointBlock | Assigned conjoint block | ❌ | ❌ |
dateTimeCreated | Datetime of participant creation | ✅ | ✅ |
dateTimeCreated | Datetime of participant creation | ✅ | ✅ |
dateTimeEntered | Datetime of entering survey. It uses the responseBegin timestamp, not the actual time when the respondent saw the first frame of the survey. In case of a slow connection like 3G, the delay can be up to half a minute. | ✅ | ✅ |
dateTimeFinished | Datetime of finishing survey | ❌ | ❌ |
length | Length of interview in seconds (Length of interview in seconds so far) | ✅ | ✅ |
code | Code shown to respondents at the end of survey | ❌ | ❌ |
ip | IP address | ❌ | ✅ |
locationCity | Location: City | ❌ | ❌ |
locationRegion | Location: Region | ❌ | ❌ |
locationPostcode | Location: Postcode | ❌ | ❌ |
locationCountry | Location: Country | ❌ | ❌ |
locationLatitude | Location: Latitude | ❌ | ✅ |
locationLongitude | Location: Longitude | ❌ | ✅ |
device | Device type | ❌ | ✅ |
isTouchEnabled | Is touch enabled on device | ❌ | ✅ |
browser | Browser string | ❌ | ✅ |
locale | Locale | ✅ | ✅ |
referrer | Referrer URL | ❌ | ✅ |
externalVariable
Retrieves uploaded variables for the respondent.
Usage: externalVariable({variable_name})
Example: externalVariable("age")
segregation
Retrieves segregation value for a specific scenario for the respondent.
Usage: externalVariable({scenario_name})
Example: segregation("Scenario 1")