In AskiaScript, the response type variable contains all available information and actions that can be executed on a response item.
To create a response type variable, create a response in the survey structure. This object is accessible through the Responses Collection via the properties Responses, AvailableResponses and Answers of the question object.
Returns the caption of the response.
Returns a String.
gender.Responses[1].Caption ' => "Man"
Returns the list of child responses for a given response.
Returns a collection of responses.
CurrentQuestion.AvailableResponses.Roots[1].Children
Returns the entry-code of the response as a number.
Returns a Number.
brands.Responses[1].EntryCodeStr ' => "001"
brands.Responses[1].EntryCode ' => 1
Returns the entry-code of the response as a string.
Returns a String.
country.Responses[1].EntryCodeStr ' => "US"
Returns a factor, if it was entered in the value column of the scale responses.
Returns a Number.
gender.Responses[1].Factor ' => 3
country.AvailableResponses[1].Factor ' => 7
Internal unique identifier of the response.
Returns a Number.
CurrentQuestion.AvailableResponses[1].id ' => 456
CurrentQuestion.AvailableResponses[2].id ' => 455
Returns the index of the response (based 1) as it was entered.
gender.Responses[1].Index ' => 1
gender.Responses[2].Index ' => 2
Indicates whether the response is considered (flag) as a "Don't know" or "Not asked" answer.
This property always returns True for a single closed question, even if it is linked into a multiple.
Returns a Boolean.
gender.Responses[3].IsExclusive ' => True
Indicates if the response is a header response.
Returns a Boolean.
CurrentQuestion.AvailableResponses[1].IsHeader ' => true
CurrentQuestion.AvailableResponses[2].IsHeader ' => false
Indicates whether the response is ignored.
Returns a Boolean.
brands.Responses[5].IsIgnored ' => False
Indicates if the response is a semi open response.
Returns a Boolean.
CurrentQuestion.AvailableResponses[1].IsOpen ' => true
CurrentQuestion.AvailableResponses[2].IsOpen ' => false
Indicates if the response was previously selected (included in the Question.Answers collection).
Returns a Boolean.
CurrentQuestion.AvailableResponses[1].IsSelected ' => true
CurrentQuestion.AvailableResponses[2].IsSelected ' => false ' Similar than ' CurrentQuestion.Value Has CurrentQuestion.AvailableResponses[2].Index
Returns the question object attached to the semi open response.
Returns a Question.
brands.Responses[5].OpenQuestion
Returns the order of the response (based 1) as it was displayed during the interview. Returns DK if the question is skipped or the response was ignored.
Returns a Number.
brands.Responses[1].Order ' => 2
brands.Responses[2].Order ' => 1
Returns the parent response.
Returns a response.
CurrentQuestion.AvailableResponses.Roots[1].Children[1].Parent
Indicates in which order the answer has been selected by the respondent.
The possible range of values runs from 0 (when the response was not selected) to the number of selected answers by the respondent.
Returns a Number.
CurrentQuestion.AvailableResponses[1].Rank ' => 0 (not selected)
CurrentQuestion.AvailableResponses[2].Rank ' => 2 (second selected)
CurrentQuestion.AvailableResponses[3].Rank ' => 1 (first selected)
Returns the URL of any resource for the response.
Returns a String.
gender.Responses[1].ResourceURL ' => "/man.png"
Returns an Array of String.
Returns the description of the routing associated with that response with a simple assisted condition (one condition) using the “Has” operator
gender.Responses[1].Routings ' => {"Show message Attention 1";"Show message Attention 3"}
Returns an Array of String.
gender.Responses[1].Scenarios ' => {"Scenario1";"Scenario2"}
gender.Responses[1].Scenarios.Count ' => "2"
gender.Responses[1].Scenarios[2] ' => "Scenario2"
Returns an Array of String.
gender.Responses[1].Tags ' => {"tag1";"tag2"}
gender.Responses[1].Tags.Count ' => "2"
gender.Responses[1].Tags[2] ' => "tag2"
Returns a String.
gender.Responses[1].UserData ' => Some user data
Returns the full name of the HTML input for this response.
Returns a String.
' Single
gender.InputName() ' => "U0"
gender.Responses[1].InputName() ' => "U0"
gender.Responses[2].InputName() ' => "U0"
' Multiple brands.InputName() ' => "M2" brands.Responses[1].InputName() '=> "M2 510" brands.Responses[2].InputName() '=> "M2 511"
' Multiple with ranking
brands.InputName("ranking") ' => "R2"
brands.Responses[1].InputName("ranking") '=> "R2 510"
brands.Responses[2].InputName("ranking") '=> "R2 511"
Returns the HTML input value attribute for this response.
Returns a String.
' Single
gender.Responses[1].InputValue() ' => "456" gender.Responses[2].InputValue() ' => "457"
' Multiple brands.Responses[1].InputValue() ' => "510" brands.Responses[2].InputValue() ' => "511" ' Where brands.Responses[2].InputName() => "M2 511"
' Multiple with ranking
brands.Responses[1].InputValue("ranking") ' => "2"
brands.Responses[2].InputValue("ranking") ' => "1"
' Where brands.Responses[2].InputValue() => "511"
Returns a string which represents the response (expressed in JSON format).
Returns a String.
' Output in a single line (it's break here for the readability)
gender.Responses[1].ToString()
' => {
"index":1,
"entryCode":"001",
"caption":"Man",
"isExclusive":true,
"isSelected":true,
"resourceUrl":"./Man.png"
}
Always returns "response".
Returns a String.
gender.Responses[1].TypeOf() ' => "response"
All operators for a Number type variable are available using the response object. In the case of the response object, the method will be executed on the Index of the response object. Please refer to the Number type operators for details.
brands.AvailabeResponses[1] + 2 ' Equivalent to ' brands.AvailableResponses[1].Index + 2