Actions

Import responses: Difference between revisions

From LimeSurvey Manual

Line 71: Line 71:
*Question is added to target (result is set to database default value).}}
*Question is added to target (result is set to database default value).}}


==Importing a VV survey file==
==Import a VV survey file==
 
 
If you click the '''Import a VV survey file''' button, the following page will be loaded:




Line 79: Line 82:
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.
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.


Then, click on the "Import a VV Survey file" button from the browse screen.
<!--T:229-->
 
* '''Response data file''' : select the file to be uploaded from your machine. The accepted file formats are : *.csv, *.vv, *.txt.
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")


* '''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:


<!--T:229-->
* '''When an imported record matches an existing record ID''' (displayed if '''exclude record IDs''' is disabled):
* '''File''' : Select the file to be uploaded. The file must be a [[wikipedia:Tab-separated_values|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.
** ''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.
** ''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
** ''replace'' : Replace the existing record. The old record is deleted and completely replaced by the record from the VV file
** ''replace answer'' : 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.
** ''replace answer'' : 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.
* '''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.
* '''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.
* '''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 [[Expression_Manager#Qcode_Variable_Naming|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.
* '''Force import''' : If the question codes are not found in the database name or in [[Expression_Manager#Qcode_Variable_Naming|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.



Revision as of 19:27, 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: select the table you wish to export. Please note that the tables can be located in either under the compatible tab or under the compatible with type coercion tab. Please continue reading below to understand what the last option is as well as the possible risks of type coercing a response table.
  • Import timings (if exist): timings are not displayed in the response table but in the timings table. If enabled, the timings will also be imported.


To use timings, please enable this feature from here.


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 being 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).


Import a VV survey file

If you click the Import a VV survey file button, the following page will be loaded:


[[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.

  • Response data file : select the file to be uploaded from your machine. The accepted file formats are : *.csv, *.vv, *.txt.
  • 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 (displayed if exclude record IDs is disabled):
    • 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
    • replace answer : 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.


Potential issues & solutions with the VV file

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:

  1. Open your exported vv file in Excel and do your edits.
  2. Save it as tab-separated text file (It creates a new file with the extension .txt).
  3. Do another "clean" vv export from LimeSurvey.
  4. Open this new exported vv file with a text editor like notepad (or anything similar).
  5. Press CTRL + A to mark all of the content and delete it.
  6. Open the Excel edited vv file (the tab separated .txt file) with a text editor and press CTRL + A to mark all the content.
  7. Press CTRL + C to copy the content and paste it into the new (now empty) vv file.
  8. Press CTRL + S to save the file as it is (in .csv format).
  9. Try now to import this file.


  Attention : Possible import errors include date format - some system date fields do not allow a NULL value, some do. If the date looks okay but gives an error, use the Excel cell format "2009-12-01".