In AskiaScript, the responses collection type variable contains a collection of responses; it is, in effect, an array of responses.
A responses collection type variable can be created through a closed question object (Responses, AvailableResponses and Answers properties).
In this topic:
The [index] is the accessor of response. It returns the response object at the specified index. This accessor property is used without the dot period (.), like an array accessor.
Returns a Response.
gender.Responses[1] ' => <Response::1#Man>
gender.Responses[2] ' => <Response::2#Woman>
Returns an array containing the captions of the responses in the referenced question.
Returns an Array of Strings.
gender.Responses.Caption ' => {"Man"; "Woman"}
Returns the number of items in the collection.
Returns a Number.
gender.Responses.Count ' => 2
Returns an array containing the entry-codes of the responses in the referenced question, as numbers.
Returns an Array of Numbers.
brands.Responses.EntryCodeStr ' => {"001"; "002"; "003"}
brands.Responses.EntryCode ' => {1; 2; 3}
Returns an array containing the entry-codes of the responses in the referenced question.
Returns an Array of Strings.
country.Responses.EntryCodeStr ' => {"US"; "UK"; "FR"}
Returns an array of factors as entered in the value column of the scale responses.
Returns an array.
gender.Responses.Factor ' => 3;8
country.AvailableResponses.Factor ' => 7;3;8;6
Returns an array of responses indexes (based 1).
Returns an Array of Numbers.
gender.Responses.Index ' => {1; 2}
country.AvailableResponses.Index ' => {2; 3; 1}
Returns an array containing the URLs of any response resources in the referenced question.
Returns an Array of Strings.
gender.Responses.ResourceURL ' => {"/man.png"; "/woman.png"}
Returns only the root list of responses/items so level 1.
Returns a collection of responses.
CurrentQuestion.AvailableResponses.Roots
Returns an array of strings.
CurrentQuestion.Answers.Tags Has {"Luxury"}
Return the list of all the responses with the tag provided as string or the list of tags provided as array of string.
Returns a Collection of Responses.
Brands.Answers.FilterByTag("luxury") => 'Return the list of all responses given to the question brands with a tag luxury
Brands.Responses.FilterByTag({"beverage"; "luxury"}) => 'Return the list of all responses from the brands question with a tag beverage or luxury
Returns a string which represents the responses collection (expressed in JSON format).
Returns a String.
' Output in a single line (it's broken here for the sake of readability)
gender.Responses.ToString()
' => [{
"index":1,
"entryCode":"001",
"caption":"Man",
"isExclusive":true,
"resourceUrl":"./Man.png"
},{
"index" : 2,
"entryCode":"002",
"caption":"Woman",
"isExclusive":true,
"resourceUrl":"./Woman.png"
}]
Always returns "responses".
Returns a String.
gender.Responses.TypeOf() ' => "responses"
The value(s) of the responses object could be a Number, a String or an Array. Please see the section on operators for each type for more details.