Welcome to the LimeSurvey Community Forum

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

How to export all surveys at once using the Exporting results function

  • yuto0419
  • yuto0419's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 months 1 week ago - 6 months 1 week ago #265397 by yuto0419
Please help us help you and fill where relevantlease help us help you and fill where relevant:
Your LimeSurvey version: 5.6.9+230306
Own server or LimeSurvey hosting:Own server(Azure)
Survey theme/template:fruity
==================
Is there a way to export all surveys at once using the Exporting results function?
I would like to export them with column control set.

If the above is difficult, is it possible to implement a regular batch by calling the Exporting results function ("application\controllers\admin\Export.php exportresults"?) with your own PHP?


We need to regularly submit response data in a CSV file specified by the customer.
Until now, we have dealt with this issue by creating a view table that limits the items we want to output from the lime_survey_xxxxxx table in the database, but because the content of the questions and the format of the CSV file specified by the customer change regularly, we have had to recreate the view table each time.
This would be done for all 12 surveys, which would be extremely inefficient.


I recently learned about the Exporting results function and would like to ask about it as I believe it may help improve our inefficient work.
Last edit: 6 months 1 week ago by yuto0419.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 months 1 week ago #265410 by Joffm
Hi,
what about using the API?
[url] www.limesurvey.org/manual/RemoteControl_2_API [/url]
with these methods
[url] api.limesurvey.org/classes/remotecontrol-handle.html [/url]

And you can define the columns you want to export (php example)
Code:
...
$surveyResponses = $myJSONRPCClient->export_responses(
    $sessionKey,
    $survey_id,
    'csv',            // Document type : pdf,csv,xls,doc,json
    NULL,         // Language code : null : default from survey
    'complete',  // Stautus complete|incomplete|all
    NULL,         // Heading : code|full|abbreviated : question text, default code
    NULL,        // answer : short|long , default : long
    1,               // From Response ID
    30000,       // To Response ID
    ['id','token','submitdate','lastpage','interviewtime','email','159677X490time','159677X487time','159677X490X9219SQ001','159677X490X9221SQ001']
);
...
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

  • yuto0419
  • yuto0419's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 months 3 weeks ago #265742 by yuto0419

Hi,
what about using the API?
[url] www.limesurvey.org/manual/RemoteControl_2_API [/url]
with these methods
[url] api.limesurvey.org/classes/remotecontrol-handle.html [/url]

And you can define the columns you want to export (php example)
Code:
...
$surveyResponses = $myJSONRPCClient->export_responses(
    $sessionKey,
    $survey_id,
    'csv',            // Document type : pdf,csv,xls,doc,json
    NULL,         // Language code : null : default from survey
    'complete',  // Stautus complete|incomplete|all
    NULL,         // Heading : code|full|abbreviated : question text, default code
    NULL,        // answer : short|long , default : long
    1,               // From Response ID
    30000,       // To Response ID
    ['id','token','submitdate','lastpage','interviewtime','email','159677X490time','159677X487time','159677X490X9219SQ001','159677X490X9221SQ001']
);
...


 

Is there an API to get the field names "'159677X490time', '159677X487time', '159677X490X9219SQ001', '159677X490X9221SQ001'" and the question and subquestion names that match the field names?

[url] api.limesurvey.org/classes/remotecontrol-handle.html [/url]
I searched this site but couldn't find it.

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
5 months 3 weeks ago #265746 by DenisChenu
It's time export part,
When you choose sHeadingType : you don't have the code ? Maybe it's an issue here. Can you check the question code when export via GUI ?
I must check how it's exported in 3.X or 5.X , unsure it use question code …

Else : you can use any export. To have a dictionary :
1. R syntax ?
2. Stata ?
3. Triple S syntax gitlab.com/SondagesPro/ExportAndStats/exportTripleS ?

Maybe you can export as lss, but in my opinion : it's more complex for analysis
 

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose