Welcome to the LimeSurvey Community Forum

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

Problems with RPC: export_responses

  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
6 years 10 months ago - 6 years 10 months ago #153879 by tammo
From within R I am trying to get export_responses working on my RStudio on Windows10

There are some things that go wrong:
  1. One of my surveys is quite big: about 80.000 responses with 155 variables. I cannot read that, it resulted in an error message: Error: parse error: premature EOF. Another large survey (32000 repondents) I could read though.
  2. OK, I thought to be clever and restrict the output by ID using iFromResponseID = 0 and iToResponseID = 200, but this does not work, even when I try it on another survey, where I can read all responses. It results in no output at all. Quoting or unquoting the integers makes no difference.
  3. Then I thought I would restrict the output by fields, using aFields=list("id", "datestamp"), but this does nothing: when using it on another survey, I just get all fields

My questions are:
- Where lies the bottleneck in the number of responses that LimeSurvey can spit up? Is it in the server, LimeSurvey or in my computer?

- Do I do something wrong in using
<iFromResponseID = 0 and iToResponseID = 200>
or did I run into a bug?

- Is it possible to restrict the fields I want to retrieve and how. What is wrong in my code?

- when you retrieve by ID, will it use the ID as it is in the response table or another internal ID?

Used code:

results<-base64_to_df(call_limer(method="export_responses",
params = list (iSurveyID=284265,
sDocumentType="csv",
sLanguageCode="nl-informal",
iFromResponseID = "0",
iToResponseID = "116",
sCompletionStatus= "complete",
sHeadingType = "code",
sResponseType = "short",
aFields = list("id", "datestamp"))))


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Last edit: 6 years 10 months ago by tammo.
The topic has been locked.
  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
6 years 10 months ago #154430 by tammo
Replied by tammo on topic Problems with RPC: export_responses
As it turns out, the RPC is sensitive to the order in which it gets feeded the parameters. You need to use exactly the right order as stated in the API documentation at:

api.limesurvey.org/classes/remotecontrol_handle.html

So the correct statement (which works) for the previous post is:

temp<-base64_to_df(call_limer(method="export_responses",
params = list (iSurveyID=SID,
sDocumentType="csv",
sLanguageCode="nl-informal",
sCompletionStatus= "complete",
sHeadingType = "code",
sResponseType = "short",
iFromResponseID = "0",
iToResponseID = "1160",
aFields = list("id", "datestamp")
)))


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
6 years 10 months ago #154431 by tammo
Replied by tammo on topic Problems with RPC: export_responses
So, part of my problem is solved now. Still hope to hear more about the limits of responses you can get out of LS in one run.

Tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose