Actions

Import responses: Difference between revisions

From LimeSurvey Manual

mNo edit summary
m (Text replacement - "Expression Manager" to "ExpressionScript")
 
(19 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<languages />
<translate>


=Introduction=
<!--T:230-->
__TOC__




=Introduction= <!--T:231-->
<!--T:232-->
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:  
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:  


<!--T:233-->
* 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.
* 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.


<!--T:234-->
* 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.
* 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.


<!--T:235-->
* 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.
* 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.




<!--T:236-->
To access the import functionality, select '''Responses & statistics''' from the main toolbar (displayed on any survey-related panel) and then click on [[Responses]]:
To access the import functionality, select '''Responses & statistics''' from the main toolbar (displayed on any survey-related panel) and then click on [[Responses]]:




<!--T:237-->
<center>[[File:browse_results.png]]</center>
<center>[[File:browse_results.png]]</center>




<!--T:238-->
The default page, Response summary will be loaded. Now, look for the '''Import''' option located on the top top toolbar:
The default page, Response summary will be loaded. Now, look for the '''Import''' option located on the top top toolbar:


Line 25: Line 38:




<!--T:239-->
Two import options are available:
Two import options are available:
* [[Import responses|Import responses from a deactivated survey table|Import responses from a deactivated survey table]]
* [[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 responses#Import a VV survey file|Import a VV survey file]]




=Import=
=Import= <!--T:240-->




==Import responses from a deactivated survey table==
==Import responses from a deactivated survey table== <!--T:241-->




<!--T:242-->
Once clicked on '''Import responses from a deactivated survey table''', the following page will be loaded:
Once clicked on '''Import responses from a deactivated survey table''', the following page will be loaded:




<!--T:243-->
<center>[[File:Import responses from a deactivated survey table.png]]</center>
<center>[[File:Import responses from a deactivated survey table.png]]</center>




<!--T:244-->
Two options are selectable on this page:
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.
<!--T:245-->
*'''Source table''': select the table you wish to import. 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.


<!--T:246-->
*'''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.
*'''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.




<!--T:247-->
{{Note|To use timings, please enable this feature from [[Notifications_%26_data#Save_timings|here]].}}
{{Note|To use timings, please enable this feature from [[Notifications_%26_data#Save_timings|here]].}}




<!--T:248-->
In the second part of the page, a '''warning message''' is displayed stating how compatibility is determine between two response tables (between the current one and the old/second one).
In the second part of the page, a '''warning message''' is displayed stating how compatibility is determine between two response tables (between the current one and the old/second one).




<!--T:249-->
{{Alert|title=Warning|</br>
{{Alert|title=Warning|</br>


<!--T:250-->
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.
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.


<!--T:251-->
'''Using type coercion may break your data; use with care or not at all if possible.'''
'''Using type coercion may break your data; use with care or not at all if possible.'''


<!--T:252-->
LimeSurvey detects and handles the following changes:
LimeSurvey detects and handles the following changes:


<!--T:253-->
*Question is moved to another group (result is imported correctly).
*Question is moved to another group (result is imported correctly).


<!--T:254-->
*Question is removed from target (result is ignored).
*Question is removed from target (result is ignored).


<!--T:255-->
*Question is added to target (result is set to database default value).}}
*Question is added to target (result is set to database default value).}}


==Import a VV survey file== <!--T:256-->
<!--T:257-->
If you click the '''Import a VV survey file''' button, the following page will be loaded:
<!--T:258-->
<center>[[File:Import a vv response data file panel.png]]</center>


==Import a VV survey file==


<!--T:229-->
* '''Response data file:''' select the file to be uploaded from your machine. The accepted file formats are : *.csv, *.vv, *.txt.
<!--T:259-->
{{Note|As long as the first two lines are intact, you can import your vv survey file back into an active LimeSurvey survey.}}


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


<!--T:260-->
* '''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:


<center>[[File:]]</center>


<!--T:261-->
<center>[[File:Exclude_record_ids_importvv.png]]</center>


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:229-->
<!--T:262-->
* '''Response data file''' : select the file to be uploaded from your machine. The accepted file formats are : *.csv, *.vv, *.txt.
* '''When an imported record matches an existing record ID''' (displayed if '''exclude record IDs''' is disabled, see the above screenshot):
** ''skip:'' report and skip the new record. After upload you will see if the record already existed - if it did 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 vv file into the existing record. The old record is updated with the new response from the VV file.


* '''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:263-->
* '''Import as not finalized response?:''' if checked, the submitdate is set to NULL - the response is set to not completed.


* '''When an imported record matches an existing record ID''' (displayed if '''exclude record IDs''' is disabled):
<!--T:264-->
** ''skip'' : Report and skip the new record. After upload you will see if the record already existed - if it existed it's not imported.
* '''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.
** ''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.
<!--T:265-->
* '''First line contains question codes:''' iy default, VV file's first line contains the human readable question, the real column names being located on the second line. Basically, the first line contains the real column names.


* '''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.
<!--T:266-->
* '''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 the VV file from different LimeSurvey instance. Regardless of this, each survey must be exactly the same. We strongly recommend to use this option only if you know what you are doing. It can be very dangerous - the results can end up in the wrong column.


* '''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.
===Reserved names=== <!--T:272-->


<!--T:273-->
The reserved names are located between left and right brackets. When the .VV file is imported back into LimeSurvey, the strings are being replaced with:
* <code>{question_not_shown}</code> : NULL value in database. LimeSurvey uses [empty string] for questions that were not answered and NULL value for questions that have not been shown (e.g., when using the ExpressionScript).
* <code>{quote}</code> : " (a double quote)
* <code>{cr}</code> : Carriage return
* <code>{newline}</code> : A new line
* <code>{lbrace}</code> : Left bracket (for example, if you want to have {cr} in response, use <code>{lbrace}cr}</code>)


===Potential issues & solutions with the VV file===
===Potential issues & solutions with the VV file=== <!--T:267-->




<!--T:268-->
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:
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:


<!--T:269-->
#Open your exported vv file in Excel and do your edits.
#Open your exported vv file in Excel and do your edits.
#Save it as tab-separated text file (It creates a new file with the extension .txt).
#Save it as tab-separated text file (it creates a new file with the extension .txt).
#Do another "clean" vv export from LimeSurvey.
#Do another "clean" vv export from LimeSurvey.
#Open this new exported vv file with a text editor like notepad (or anything similar).
#Open this new exported vv file with a text editor like notepad (or anything similar).
Line 117: Line 172:




<!--T:270-->
{{Alert|title=Attention|text=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".}}
{{Alert|title=Attention|text=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".}}
<!--T:271-->
{{Note|For other problems & solutions related to the export and import functionalities provided by LimeSurvey, please check the following [[Problems & solutions|wiki section]]. In the case in which you found a bug or something is not working properly/as described in the manual, please open a ticket (via your limesurvey.org administration panel), create a [https://www.limesurvey.org/community/forums forum post], or submit directly a bug report on our [https://bugs.limesurvey.org/ bugs tracker].}}
</translate>

Latest revision as of 15:50, 11 February 2020


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:



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 import. 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 (between the current one and the old/second one).


  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.

LimeSurvey detects and handles 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:



  • Response data file: select the file to be uploaded from your machine. The accepted file formats are : *.csv, *.vv, *.txt.


As long as the first two lines are intact, you can import your vv survey file back into an active LimeSurvey 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:



  • When an imported record matches an existing record ID (displayed if exclude record IDs is disabled, see the above screenshot):
    • skip: report and skip the new record. After upload you will see if the record already existed - if it did 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 vv file into the existing record. The old record is updated with the new response from the VV file.
  • Import as not finalized response?: if checked, the submitdate is set to NULL - 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: iy default, VV file's first line contains the human readable question, the real column names being located on the second line. Basically, the first line contains 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 the VV file from different LimeSurvey instance. Regardless of this, each survey must be exactly the same. We strongly recommend to use this option only if you know what you are doing. It can be very dangerous - the results can end up in the wrong column.


Reserved names

The reserved names are located between left and right brackets. When the .VV file is imported back into LimeSurvey, the strings are being replaced with:

  • {question_not_shown} : NULL value in database. LimeSurvey uses [empty string] for questions that were not answered and NULL value for questions that have not been shown (e.g., when using the ExpressionScript).
  • {quote} : " (a double quote)
  • {cr} : Carriage return
  • {newline} : A new line
  • {lbrace} : Left bracket (for example, if you want to have {cr} in response, use {lbrace}cr})

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



For other problems & solutions related to the export and import functionalities provided by LimeSurvey, please check the following wiki section. In the case in which you found a bug or something is not working properly/as described in the manual, please open a ticket (via your limesurvey.org administration panel), create a forum post, or submit directly a bug report on our bugs tracker.