apilimesurvey

Limesurvey get combo values of a question


When I perform an export_responses call to the API, I get the questions and values.

For combo type questions, I get the ID of the selected option, but not the description. How can I access the descriptions of these values?

Thank you in advance!


Solution

  • The parameter sResponseType in the API allows you to choose if you want to get the Answer Codes or the Answer Texts.

    Please see https://api.limesurvey.org/classes/remotecontrol_handle.html#method_export_responses

    Export token response in a survey.

    export_responses_by_token(string $sSessionKey, integer $iSurveyID, string $sDocumentType, string $sToken, string $sLanguageCode = null, string $sCompletionStatus = 'all', string $sHeadingType = 'code', string $sResponseType = 'short', array $aFields = null) : array|string

    ... ...

    sResponseType (optional)'short' or 'long' Optional defaults to 'short'