Actions

Import responses: Difference between revisions

From LimeSurvey Manual

mNo edit summary
mNo edit summary
Line 1: Line 1:
{{Alert|Under construction}}
=Introduction=
The '''import responses''' feature refers to the ability of LimeSurvey to import and display old responses into its own [[Responses|Response table]]. Some scenarios when you could use it:
* you wish to combine all your data gathered in two or more LimeSurvey instances into one LimeSurvey instances. This is usually done to get a better perspective on all the responses you wish to further analyse.
* some questions are not set to the right type. Since LimeSurvey does not allow to change the question type as long as the survey is live, you will have to deactivate it. By deactivating it, a response table is getting created and stored into the database associated to your LimeSurvey installation. Once you are done with your changes, reactivate your survey and [[Import responses#Import responses from a deactivated survey table|reimport your responses]] from the old response database.
* you wish to batch-edit multiple lines in a spreadsheet software and later import them again into your installation. This is usually the case in which you changed a question type and wish to "adjust" the old stored answers to the new format.
To access the import functionality, select '''Responses & statistics''' from the main toolbar (displayed on any survey-related panel) and then click on [[Responses]]:
<center>[[File:browse_results.png]]</center>
The default page, Response summary will be loaded. Now, look for the '''Import''' option located on the top top toolbar:
<!--T:6-->
<center>[[File:]]</center>
Two import options are available:
* [[Import responses|Import responses from a deactivated survey table|Import responses from a deactivated survey table]]
* [[Import responses|Import a VV survey file|Import a VV survey file]]
=Import=
==Import responses from a deactivated survey table==
Once clicked on '''Import responses from a deactivated survey table''', the following page will be loaded:
<center>[[File:Import responses from a deactivated survey table.png]]</center>
<!--T:127-->
As long as the first two lines are intact, you can import the data in your vv survey file back into an active LimeSurvey survey.
<!--T:128-->
{{Alert|title=Attention|text=If you used Microsoft Excel to edit the exported vv file, the data structure of this file may be corrupted, so LimeSurvey is not able to import the edited file. You can try the following workaround to get the import working without an error:
*Open your exported vv file in Excel and do your changes (I guess you already did that)
*Save it as tab-separated text file (It creates a new file with the extension .txt)
*Do another "clean" vv export from LimeSurvey
*Open this new exported vv file with a texteditor like notepad or something else (I used textwrangler on mac)
*Press CTRL + A to mark all of the content and delete it
*Open the Excel edited vv file (the tab separated .txt file) with a texteditor and press CTRL + A to mark all of the content
*Press CTRL + C to copy the content and paste it into the new (now empty) vv file
*Press CTRL + S to save the file as it is (as .csv)
*Try now to import this file}}
{{Alert|Under construction}}
{{Alert|Under construction}}


Line 153: Line 94:
*Renumber the new record
*Renumber the new record
*Replace the existing record (uses this for the use case "Overwriting all responses of the survey")
*Replace the existing record (uses this for the use case "Overwriting all responses of the survey")





Revision as of 13:46, 14 February 2019

  Under construction



Introduction

The import responses feature refers to the ability of LimeSurvey to import and display old responses into its own Response table. Some scenarios when you could use it:

  • you wish to combine all your data gathered in two or more LimeSurvey instances into one LimeSurvey instances. This is usually done to get a better perspective on all the responses you wish to further analyse.
  • some questions are not set to the right type. Since LimeSurvey does not allow to change the question type as long as the survey is live, you will have to deactivate it. By deactivating it, a response table is getting created and stored into the database associated to your LimeSurvey installation. Once you are done with your changes, reactivate your survey and reimport your responses from the old response database.
  • you wish to batch-edit multiple lines in a spreadsheet software and later import them again into your installation. This is usually the case in which you changed a question type and wish to "adjust" the old stored answers to the new format.


To access the import functionality, select Responses & statistics from the main toolbar (displayed on any survey-related panel) and then click on Responses:



The default page, Response summary will be loaded. Now, look for the Import option located on the top top toolbar:


[[File:]]


Two import options are available:


Import

Import responses from a deactivated survey table

Once clicked on Import responses from a deactivated survey table, the following page will be loaded:



Two options are selectable on this page:

  • Source table
  • Import timings (if exist)

In the second part of the page, a Warning message is displayed stating how compatibility is determine between two response tables

  Warning : You can import all old responses that are compatible with your current survey. Compatibility is determined by comparing column types and names, the ID field is always ignored.

Using type coercion may break your data; use with care or not at all if possible.

Currently we detect and handle the following changes:

  • Question is moved to another group (result is imported correctly).
  • Question is removed from target (result is ignored).
  • Question is added to target (result is set to database default value).



Importing a VV survey file

As long as the first two lines are intact, you can import the data in your vv survey file back into an active LimeSurvey survey.

  Attention : If you used Microsoft Excel to edit the exported vv file, the data structure of this file may be corrupted, so LimeSurvey is not able to import the edited file. You can try the following workaround to get the import working without an error:
  • Open your exported vv file in Excel and do your changes (I guess you already did that)
  • Save it as tab-separated text file (It creates a new file with the extension .txt)
  • Do another "clean" vv export from LimeSurvey
  • Open this new exported vv file with a texteditor like notepad or something else (I used textwrangler on mac)
  • Press CTRL + A to mark all of the content and delete it
  • Open the Excel edited vv file (the tab separated .txt file) with a texteditor and press CTRL + A to mark all of the content
  • Press CTRL + C to copy the content and paste it into the new (now empty) vv file
  • Press CTRL + S to save the file as it is (as .csv)
  • Try now to import this file


Then, click on the "Import a VV Survey file" button from the browse screen.

The "Import a VV Survey File" screen needs you to choose the "vvexport" file you are importing. If you choose to "Exclude Record IDs" the records will be imported and brand new Record ID's will be generated for them (use this option for the use case "Adding new responses to the existing responses of a survey"). If you un-check this box, then the original record id's will be imported (use this option for the use case "Overwriting all responses of the survey").

There are a range of options you can choose that tell LimeSurvey how to deal with double or multiple entries.

  • Report an error (and skip the new record).
  • Renumber the new record
  • Replace the existing record (uses this for the use case "Overwriting all responses of the survey")


[[File:]]


  • File : Select the file to be uploaded. The file must be a TSV file: A text file with each column separated by TAB.
  • Exclude record IDs? : If 'id' column exist in the file you can exclude this line or not. If this setting is checked then a new record is added for each line of the .vv file. If unchecked you can choose:
  • When an imported record matches an existing record ID:
    • skip : Report and skip the new record. After upload you will see if the record already existed - if it existed it's not imported.
    • renumber : Renumber the new record. A new record is added to the response table with answer of the VV file.
    • replace : Replace the existing record. The old record is deleted and completely replaced by the record from the VV file
    • replaceanswer : Replace response details from the file in the existing record. The old record is updated with the new response from the VV file. This allow to replace only one question in the response table.
  • Import as not finalized response? : If checked the submitdate is set to NULL, so the response is set to not completed.
  • Character set of the file : You can choose the character set of the file - the default and recommended value is UTF-8 but some spreadsheet program don't allow to choose a character set.
  • First line contains question codes : By default VV file first line contain human readable question, the real column names are in the second line. This allow to use the first line as the real column names.
  • Force import : If the question codes are not found in the database name or in Qcode Variable Naming then columns are assigned depending of order. This can be used to import VV file from different LimeSurvey instance but each survey must be exactly the same. We strongly recommend to use this only if you know what you are doing. It can be very dangerous and lead to results ending up in the wrong column.

Then, click on the "Import a VV Survey file" button from the browse screen.

The "Import a VV Survey File" screen needs you to choose the "vvexport" file you are importing. If you choose to "Exclude Record IDs" the records will be imported and brand new Record ID's will be generated for them (use this option for the use case "Adding new responses to the existing responses of a survey"). If you un-check this box, then the original record id's will be imported (use this option for the use case "Overwriting all responses of the survey").

There are a range of options you can choose that tell LimeSurvey how to deal with double or multiple entries.

  • Report an error (and skip the new record).
  • Renumber the new record
  • Replace the existing record (uses this for the use case "Overwriting all responses of the survey")


Import a VV survey file

File:VV2-import-en.png


  • File : Select the file to be uploaded. The file must be a TSV file: A text file with each column separated by TAB.
  • Exclude record IDs? : If 'id' column exist in the file you can exclude this line or not. If this setting is checked then a new record is added for each line of the .vv file. If unchecked you can choose:
  • When an imported record matches an existing record ID:
    • skip : Report and skip the new record. After upload you will see if the record already existed - if it existed it's not imported.
    • renumber : Renumber the new record. A new record is added to the response table with answer of the VV file.
    • replace : Replace the existing record. The old record is deleted and completely replaced by the record from the VV file
    • replaceanswer : Replace response details from the file in the existing record. The old record is updated with the new response from the VV file. This allow to replace only one question in the response table.
  • Import as not finalized response? : If checked the submitdate is set to NULL, so the response is set to not completed.
  • Character set of the file : You can choose the character set of the file - the default and recommended value is UTF-8 but some spreadsheet program don't allow to choose a character set.
  • First line contains question codes : By default VV file first line contain human readable question, the real column names are in the second line. This allow to use the first line as the real column names.
  • Force import : If the question codes are not found in the database name or in Qcode Variable Naming then columns are assigned depending of order. This can be used to import VV file from different LimeSurvey instance but each survey must be exactly the same. We strongly recommend to use this only if you know what you are doing. It can be very dangerous and lead to results ending up in the wrong column.