Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

How do I get all the responses of a survey

  • sodiumchl
  • sodiumchl's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 1 month ago - 4 years 1 month ago #207478 by sodiumchl
How do I get all the responses of a survey? I tried
Code:
$oResponses = Response::model($iSurveyId)->findAll();
But $oResponses is always empty. (And I confirmed that $iSurveyId is valid.)
Last edit: 4 years 1 month ago by sodiumchl.
The topic has been locked.
  • sodiumchl
  • sodiumchl's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 1 month ago - 4 years 1 month ago #207480 by sodiumchl
Replied by sodiumchl on topic How do I get all the responses of a survey
And when I test with
$oResponses = Response::model($iSurveyId)->findAll("id = :id", [":id" => 1]);
I also get an empty response. I am logged in as admin, and confirm that response for id=1 exists. What I am doing wrong?
Last edit: 4 years 1 month ago by sodiumchl.
The topic has been locked.
  • sodiumchl
  • sodiumchl's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 1 month ago #207530 by sodiumchl
Replied by sodiumchl on topic How do I get all the responses of a survey
Never mind. I got it working now. (I did not pass iSurveyId to my function correctly initially.)
The following user(s) said Thank You: DenisChenu
The topic has been locked.
Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose